
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))) (t_2 (/ z (- a t))))
(if (<= t_1 (- INFINITY))
(* (- (+ (+ (/ t (- a t)) 1.0) (/ x y)) t_2) y)
(if (<= t_1 -5e-181)
t_1
(if (<= t_1 2e-198)
(+ (/ (- (* y z) (* a y)) t) x)
(- (+ x y) (* y t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double t_2 = z / (a - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((((t / (a - t)) + 1.0) + (x / y)) - t_2) * y;
} else if (t_1 <= -5e-181) {
tmp = t_1;
} else if (t_1 <= 2e-198) {
tmp = (((y * z) - (a * y)) / t) + x;
} else {
tmp = (x + y) - (y * t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double t_2 = z / (a - t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = ((((t / (a - t)) + 1.0) + (x / y)) - t_2) * y;
} else if (t_1 <= -5e-181) {
tmp = t_1;
} else if (t_1 <= 2e-198) {
tmp = (((y * z) - (a * y)) / t) + x;
} else {
tmp = (x + y) - (y * t_2);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) t_2 = z / (a - t) tmp = 0 if t_1 <= -math.inf: tmp = ((((t / (a - t)) + 1.0) + (x / y)) - t_2) * y elif t_1 <= -5e-181: tmp = t_1 elif t_1 <= 2e-198: tmp = (((y * z) - (a * y)) / t) + x else: tmp = (x + y) - (y * t_2) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) t_2 = Float64(z / Float64(a - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(Float64(t / Float64(a - t)) + 1.0) + Float64(x / y)) - t_2) * y); elseif (t_1 <= -5e-181) tmp = t_1; elseif (t_1 <= 2e-198) tmp = Float64(Float64(Float64(Float64(y * z) - Float64(a * y)) / t) + x); else tmp = Float64(Float64(x + y) - Float64(y * t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); t_2 = z / (a - t); tmp = 0.0; if (t_1 <= -Inf) tmp = ((((t / (a - t)) + 1.0) + (x / y)) - t_2) * y; elseif (t_1 <= -5e-181) tmp = t_1; elseif (t_1 <= 2e-198) tmp = (((y * z) - (a * y)) / t) + x; else tmp = (x + y) - (y * t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, -5e-181], t$95$1, If[LessEqual[t$95$1, 2e-198], N[(N[(N[(N[(y * z), $MachinePrecision] - N[(a * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_2 := \frac{z}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(\left(\left(\frac{t}{a - t} + 1\right) + \frac{x}{y}\right) - t\_2\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-198}:\\
\;\;\;\;\frac{y \cdot z - a \cdot y}{t} + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot t\_2\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 35.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6487.0
Applied rewrites87.0%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000001e-181Initial program 98.1%
if -5.0000000000000001e-181 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.9999999999999998e-198Initial program 24.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6486.6
Applied rewrites86.6%
Taylor expanded in z around 0
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
if 1.9999999999999998e-198 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 82.6%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6487.7
Applied rewrites87.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- a t)))) (t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_2 (- INFINITY))
(- x t_1)
(if (<= t_2 -5e-181)
t_2
(if (<= t_2 2e-198) (+ (/ (- (* y z) (* a y)) t) x) (- (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (a - t));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = x - t_1;
} else if (t_2 <= -5e-181) {
tmp = t_2;
} else if (t_2 <= 2e-198) {
tmp = (((y * z) - (a * y)) / t) + x;
} else {
tmp = (x + y) - t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (a - t));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = x - t_1;
} else if (t_2 <= -5e-181) {
tmp = t_2;
} else if (t_2 <= 2e-198) {
tmp = (((y * z) - (a * y)) / t) + x;
} else {
tmp = (x + y) - t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / (a - t)) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 <= -math.inf: tmp = x - t_1 elif t_2 <= -5e-181: tmp = t_2 elif t_2 <= 2e-198: tmp = (((y * z) - (a * y)) / t) + x else: tmp = (x + y) - t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(a - t))) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(x - t_1); elseif (t_2 <= -5e-181) tmp = t_2; elseif (t_2 <= 2e-198) tmp = Float64(Float64(Float64(Float64(y * z) - Float64(a * y)) / t) + x); else tmp = Float64(Float64(x + y) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / (a - t)); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 <= -Inf) tmp = x - t_1; elseif (t_2 <= -5e-181) tmp = t_2; elseif (t_2 <= 2e-198) tmp = (((y * z) - (a * y)) / t) + x; else tmp = (x + y) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(x - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, -5e-181], t$95$2, If[LessEqual[t$95$2, 2e-198], N[(N[(N[(N[(y * z), $MachinePrecision] - N[(a * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a - t}\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;x - t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-181}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-198}:\\
\;\;\;\;\frac{y \cdot z - a \cdot y}{t} + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 35.0%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6466.0
Applied rewrites66.0%
Taylor expanded in x around inf
Applied rewrites74.4%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000001e-181Initial program 98.1%
if -5.0000000000000001e-181 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.9999999999999998e-198Initial program 24.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6486.6
Applied rewrites86.6%
Taylor expanded in z around 0
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
if 1.9999999999999998e-198 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 82.6%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6487.7
Applied rewrites87.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (* y (/ z (- a t)))))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_2 -5e-181)
t_1
(if (<= t_2 2e-198) (+ (/ (- (* y z) (* a y)) t) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (y * (z / (a - t)));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -5e-181) {
tmp = t_1;
} else if (t_2 <= 2e-198) {
tmp = (((y * z) - (a * y)) / t) + 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) :: t_2
real(8) :: tmp
t_1 = (x + y) - (y * (z / (a - t)))
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 <= (-5d-181)) then
tmp = t_1
else if (t_2 <= 2d-198) then
tmp = (((y * z) - (a * y)) / t) + 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 = (x + y) - (y * (z / (a - t)));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -5e-181) {
tmp = t_1;
} else if (t_2 <= 2e-198) {
tmp = (((y * z) - (a * y)) / t) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (y * (z / (a - t))) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 <= -5e-181: tmp = t_1 elif t_2 <= 2e-198: tmp = (((y * z) - (a * y)) / t) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 <= -5e-181) tmp = t_1; elseif (t_2 <= 2e-198) tmp = Float64(Float64(Float64(Float64(y * z) - Float64(a * y)) / t) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (y * (z / (a - t))); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 <= -5e-181) tmp = t_1; elseif (t_2 <= 2e-198) tmp = (((y * z) - (a * y)) / t) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-181], t$95$1, If[LessEqual[t$95$2, 2e-198], N[(N[(N[(N[(y * z), $MachinePrecision] - N[(a * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - y \cdot \frac{z}{a - t}\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-198}:\\
\;\;\;\;\frac{y \cdot z - a \cdot y}{t} + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000001e-181 or 1.9999999999999998e-198 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 82.2%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6487.4
Applied rewrites87.4%
if -5.0000000000000001e-181 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.9999999999999998e-198Initial program 24.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6486.6
Applied rewrites86.6%
Taylor expanded in z around 0
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ z (- a t)))) (t_2 (- (+ x y) t_1))) (if (<= a -2700000000.0) t_2 (if (<= a 84000000.0) (- x t_1) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (a - t));
double t_2 = (x + y) - t_1;
double tmp;
if (a <= -2700000000.0) {
tmp = t_2;
} else if (a <= 84000000.0) {
tmp = x - t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = y * (z / (a - t))
t_2 = (x + y) - t_1
if (a <= (-2700000000.0d0)) then
tmp = t_2
else if (a <= 84000000.0d0) then
tmp = x - t_1
else
tmp = t_2
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 - t));
double t_2 = (x + y) - t_1;
double tmp;
if (a <= -2700000000.0) {
tmp = t_2;
} else if (a <= 84000000.0) {
tmp = x - t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / (a - t)) t_2 = (x + y) - t_1 tmp = 0 if a <= -2700000000.0: tmp = t_2 elif a <= 84000000.0: tmp = x - t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(a - t))) t_2 = Float64(Float64(x + y) - t_1) tmp = 0.0 if (a <= -2700000000.0) tmp = t_2; elseif (a <= 84000000.0) tmp = Float64(x - t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / (a - t)); t_2 = (x + y) - t_1; tmp = 0.0; if (a <= -2700000000.0) tmp = t_2; elseif (a <= 84000000.0) tmp = x - t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[a, -2700000000.0], t$95$2, If[LessEqual[a, 84000000.0], N[(x - t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a - t}\\
t_2 := \left(x + y\right) - t\_1\\
\mathbf{if}\;a \leq -2700000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 84000000:\\
\;\;\;\;x - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -2.7e9 or 8.4e7 < a Initial program 79.0%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6489.5
Applied rewrites89.5%
if -2.7e9 < a < 8.4e7Initial program 74.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6473.7
Applied rewrites73.7%
Taylor expanded in x around inf
Applied rewrites87.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -15500000000000.0) (+ y x) (if (<= a 4e+91) (- x (* y (/ z (- a t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -15500000000000.0) {
tmp = y + x;
} else if (a <= 4e+91) {
tmp = x - (y * (z / (a - t)));
} else {
tmp = y + 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 <= (-15500000000000.0d0)) then
tmp = y + x
else if (a <= 4d+91) then
tmp = x - (y * (z / (a - t)))
else
tmp = y + 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 <= -15500000000000.0) {
tmp = y + x;
} else if (a <= 4e+91) {
tmp = x - (y * (z / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -15500000000000.0: tmp = y + x elif a <= 4e+91: tmp = x - (y * (z / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -15500000000000.0) tmp = Float64(y + x); elseif (a <= 4e+91) tmp = Float64(x - Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -15500000000000.0) tmp = y + x; elseif (a <= 4e+91) tmp = x - (y * (z / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -15500000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[a, 4e+91], N[(x - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -15500000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+91}:\\
\;\;\;\;x - y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.55e13 or 4.00000000000000032e91 < a Initial program 79.3%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6479.3
Applied rewrites79.3%
if -1.55e13 < a < 4.00000000000000032e91Initial program 75.1%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.8
Applied rewrites74.8%
Taylor expanded in x around inf
Applied rewrites86.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -15500000000000.0) (+ y x) (if (<= a 1.685e-9) (- x (* y (/ z (- t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -15500000000000.0) {
tmp = y + x;
} else if (a <= 1.685e-9) {
tmp = x - (y * (z / -t));
} else {
tmp = y + 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 <= (-15500000000000.0d0)) then
tmp = y + x
else if (a <= 1.685d-9) then
tmp = x - (y * (z / -t))
else
tmp = y + 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 <= -15500000000000.0) {
tmp = y + x;
} else if (a <= 1.685e-9) {
tmp = x - (y * (z / -t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -15500000000000.0: tmp = y + x elif a <= 1.685e-9: tmp = x - (y * (z / -t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -15500000000000.0) tmp = Float64(y + x); elseif (a <= 1.685e-9) tmp = Float64(x - Float64(y * Float64(z / Float64(-t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -15500000000000.0) tmp = y + x; elseif (a <= 1.685e-9) tmp = x - (y * (z / -t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -15500000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.685e-9], N[(x - N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -15500000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.685 \cdot 10^{-9}:\\
\;\;\;\;x - y \cdot \frac{z}{-t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.55e13 or 1.68500000000000007e-9 < a Initial program 79.0%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6476.4
Applied rewrites76.4%
if -1.55e13 < a < 1.68500000000000007e-9Initial program 74.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6473.7
Applied rewrites73.7%
Taylor expanded in x around inf
Applied rewrites87.7%
Taylor expanded in t around inf
mul-1-negN/A
lift-neg.f6476.8
Applied rewrites76.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -15500000000000.0) (+ y x) (if (<= a 1.685e-9) (+ (/ (* y z) t) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -15500000000000.0) {
tmp = y + x;
} else if (a <= 1.685e-9) {
tmp = ((y * z) / t) + x;
} else {
tmp = y + 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 <= (-15500000000000.0d0)) then
tmp = y + x
else if (a <= 1.685d-9) then
tmp = ((y * z) / t) + x
else
tmp = y + 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 <= -15500000000000.0) {
tmp = y + x;
} else if (a <= 1.685e-9) {
tmp = ((y * z) / t) + x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -15500000000000.0: tmp = y + x elif a <= 1.685e-9: tmp = ((y * z) / t) + x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -15500000000000.0) tmp = Float64(y + x); elseif (a <= 1.685e-9) tmp = Float64(Float64(Float64(y * z) / t) + x); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -15500000000000.0) tmp = y + x; elseif (a <= 1.685e-9) tmp = ((y * z) / t) + x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -15500000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.685e-9], N[(N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -15500000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.685 \cdot 10^{-9}:\\
\;\;\;\;\frac{y \cdot z}{t} + x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.55e13 or 1.68500000000000007e-9 < a Initial program 79.0%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6476.4
Applied rewrites76.4%
if -1.55e13 < a < 1.68500000000000007e-9Initial program 74.7%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6478.4
Applied rewrites78.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f6475.1
Applied rewrites75.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 (- INFINITY))
(* y (/ z t))
(if (<= t_1 -5e-181)
(+ y x)
(if (<= t_1 2e-198) (- x (/ (* a y) t)) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / t);
} else if (t_1 <= -5e-181) {
tmp = y + x;
} else if (t_1 <= 2e-198) {
tmp = x - ((a * y) / t);
} else {
tmp = y + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / t);
} else if (t_1 <= -5e-181) {
tmp = y + x;
} else if (t_1 <= 2e-198) {
tmp = x - ((a * y) / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = y * (z / t) elif t_1 <= -5e-181: tmp = y + x elif t_1 <= 2e-198: tmp = x - ((a * y) / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / t)); elseif (t_1 <= -5e-181) tmp = Float64(y + x); elseif (t_1 <= 2e-198) tmp = Float64(x - Float64(Float64(a * y) / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (z / t); elseif (t_1 <= -5e-181) tmp = y + x; elseif (t_1 <= 2e-198) tmp = x - ((a * y) / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-181], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 2e-198], N[(x - N[(N[(a * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-181}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-198}:\\
\;\;\;\;x - \frac{a \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 35.0%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6451.9
Applied rewrites51.9%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
Taylor expanded in z around inf
lift-/.f6440.7
Applied rewrites40.7%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000001e-181 or 1.9999999999999998e-198 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 89.3%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6471.1
Applied rewrites71.1%
if -5.0000000000000001e-181 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.9999999999999998e-198Initial program 24.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6486.6
Applied rewrites86.6%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f6464.8
Applied rewrites64.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 (- INFINITY))
(* y (/ z t))
(if (<= t_1 -5e-66) (+ y x) (if (<= t_1 2e-198) x (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / t);
} else if (t_1 <= -5e-66) {
tmp = y + x;
} else if (t_1 <= 2e-198) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / t);
} else if (t_1 <= -5e-66) {
tmp = y + x;
} else if (t_1 <= 2e-198) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = y * (z / t) elif t_1 <= -5e-66: tmp = y + x elif t_1 <= 2e-198: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / t)); elseif (t_1 <= -5e-66) tmp = Float64(y + x); elseif (t_1 <= 2e-198) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (z / t); elseif (t_1 <= -5e-66) tmp = y + x; elseif (t_1 <= 2e-198) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-66], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 2e-198], x, N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-66}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-198}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 35.0%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6451.9
Applied rewrites51.9%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
Taylor expanded in z around inf
lift-/.f6440.7
Applied rewrites40.7%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.99999999999999962e-66 or 1.9999999999999998e-198 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 88.9%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6470.6
Applied rewrites70.6%
if -4.99999999999999962e-66 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.9999999999999998e-198Initial program 47.6%
Taylor expanded in x around inf
Applied rewrites51.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.6e+185) x (if (<= t 5.6e+166) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.6e+185) {
tmp = x;
} else if (t <= 5.6e+166) {
tmp = y + 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 (t <= (-3.6d+185)) then
tmp = x
else if (t <= 5.6d+166) then
tmp = y + 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 (t <= -3.6e+185) {
tmp = x;
} else if (t <= 5.6e+166) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.6e+185: tmp = x elif t <= 5.6e+166: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.6e+185) tmp = x; elseif (t <= 5.6e+166) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.6e+185) tmp = x; elseif (t <= 5.6e+166) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.6e+185], x, If[LessEqual[t, 5.6e+166], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+185}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+166}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.60000000000000029e185 or 5.59999999999999993e166 < t Initial program 49.4%
Taylor expanded in x around inf
Applied rewrites67.4%
if -3.60000000000000029e185 < t < 5.59999999999999993e166Initial program 84.7%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6462.5
Applied rewrites62.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.4e+184) y (if (<= y 6.2e+134) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.4e+184) {
tmp = y;
} else if (y <= 6.2e+134) {
tmp = x;
} else {
tmp = y;
}
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 (y <= (-4.4d+184)) then
tmp = y
else if (y <= 6.2d+134) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.4e+184) {
tmp = y;
} else if (y <= 6.2e+134) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.4e+184: tmp = y elif y <= 6.2e+134: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.4e+184) tmp = y; elseif (y <= 6.2e+134) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.4e+184) tmp = y; elseif (y <= 6.2e+134) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.4e+184], y, If[LessEqual[y, 6.2e+134], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+184}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+134}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -4.4e184 or 6.19999999999999963e134 < y Initial program 52.7%
Taylor expanded in x around 0
*-commutativeN/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6460.9
Applied rewrites60.9%
Taylor expanded in a around inf
Applied rewrites32.1%
if -4.4e184 < y < 6.19999999999999963e134Initial program 84.5%
Taylor expanded in x around inf
Applied rewrites60.8%
(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 76.9%
Taylor expanded in x around inf
Applied rewrites50.3%
herbie shell --seed 2025101
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
(- (+ x y) (/ (* (- z t) y) (- a t))))