
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (- (/ z (- a t)) (/ t (- a t))))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z / (a - t)) - (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 * ((z / (a - t)) - (t / (a - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z / (a - t)) - (t / (a - t))));
}
def code(x, y, z, t, a): return x + (y * ((z / (a - t)) - (t / (a - t))))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z / Float64(a - t)) - Float64(t / Float64(a - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z / (a - t)) - (t / (a - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(\frac{z}{a - t} - \frac{t}{a - t}\right)
\end{array}
Initial program 98.3%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6498.3
Applied rewrites98.3%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (+ x (* y (/ z (- a t))))))
(if (<= t_1 -5000000000000.0)
t_2
(if (<= t_1 5e-6)
(fma y (/ (- z t) a) x)
(if (<= t_1 1.2) (+ x (* y (/ (- z t) (- t)))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = x + (y * (z / (a - t)));
double tmp;
if (t_1 <= -5000000000000.0) {
tmp = t_2;
} else if (t_1 <= 5e-6) {
tmp = fma(y, ((z - t) / a), x);
} else if (t_1 <= 1.2) {
tmp = x + (y * ((z - t) / -t));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(x + Float64(y * Float64(z / Float64(a - t)))) tmp = 0.0 if (t_1 <= -5000000000000.0) tmp = t_2; elseif (t_1 <= 5e-6) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (t_1 <= 1.2) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(-t)))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5000000000000.0], t$95$2, If[LessEqual[t$95$1, 5e-6], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 1.2], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := x + y \cdot \frac{z}{a - t}\\
\mathbf{if}\;t\_1 \leq -5000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 1.2:\\
\;\;\;\;x + y \cdot \frac{z - t}{-t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -5e12 or 1.19999999999999996 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 95.6%
Taylor expanded in z around inf
Applied rewrites95.3%
if -5e12 < (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000041e-6Initial program 99.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6497.8
Applied rewrites97.8%
if 5.00000000000000041e-6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.19999999999999996Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6498.6
Applied rewrites98.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (+ x (* y (/ z (- a t))))))
(if (<= t_1 -5000000000000.0)
t_2
(if (<= t_1 5e-6)
(fma y (/ (- z t) a) x)
(if (<= t_1 1.2) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = x + (y * (z / (a - t)));
double tmp;
if (t_1 <= -5000000000000.0) {
tmp = t_2;
} else if (t_1 <= 5e-6) {
tmp = fma(y, ((z - t) / a), x);
} else if (t_1 <= 1.2) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(x + Float64(y * Float64(z / Float64(a - t)))) tmp = 0.0 if (t_1 <= -5000000000000.0) tmp = t_2; elseif (t_1 <= 5e-6) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (t_1 <= 1.2) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5000000000000.0], t$95$2, If[LessEqual[t$95$1, 5e-6], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 1.2], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := x + y \cdot \frac{z}{a - t}\\
\mathbf{if}\;t\_1 \leq -5000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 1.2:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -5e12 or 1.19999999999999996 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 95.6%
Taylor expanded in z around inf
Applied rewrites95.3%
if -5e12 < (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000041e-6Initial program 99.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6497.8
Applied rewrites97.8%
if 5.00000000000000041e-6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.19999999999999996Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites97.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (/ (* (- z t) y) (- a t))))
(if (<= t_1 -1e+131)
t_2
(if (<= t_1 -1e+50)
(+ x (- (* y (/ z t))))
(if (<= t_1 5e-6)
(fma y (/ (- z t) a) x)
(if (<= t_1 2e+28) (+ x y) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = ((z - t) * y) / (a - t);
double tmp;
if (t_1 <= -1e+131) {
tmp = t_2;
} else if (t_1 <= -1e+50) {
tmp = x + -(y * (z / t));
} else if (t_1 <= 5e-6) {
tmp = fma(y, ((z - t) / a), x);
} else if (t_1 <= 2e+28) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(Float64(Float64(z - t) * y) / Float64(a - t)) tmp = 0.0 if (t_1 <= -1e+131) tmp = t_2; elseif (t_1 <= -1e+50) tmp = Float64(x + Float64(-Float64(y * Float64(z / t)))); elseif (t_1 <= 5e-6) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (t_1 <= 2e+28) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], t$95$2, If[LessEqual[t$95$1, -1e+50], N[(x + (-N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, 5e-6], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+28], N[(x + y), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+50}:\\
\;\;\;\;x + \left(-y \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -9.9999999999999991e130 or 1.99999999999999992e28 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 93.9%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6471.8
Applied rewrites71.8%
if -9.9999999999999991e130 < (/.f64 (-.f64 z t) (-.f64 a t)) < -1.0000000000000001e50Initial program 99.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6455.7
Applied rewrites55.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.3
Applied rewrites59.3%
if -1.0000000000000001e50 < (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000041e-6Initial program 99.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6495.2
Applied rewrites95.2%
if 5.00000000000000041e-6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999992e28Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites95.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))))
(if (<= t_1 -1e+131)
(* y (/ z (- a t)))
(if (<= t_1 -1e+50)
(+ x (- (* y (/ z t))))
(if (<= t_1 5e-6)
(fma y (/ (- z t) a) x)
(if (<= t_1 2e+28) (+ x y) (* (- z t) (/ y (- a t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= -1e+131) {
tmp = y * (z / (a - t));
} else if (t_1 <= -1e+50) {
tmp = x + -(y * (z / t));
} else if (t_1 <= 5e-6) {
tmp = fma(y, ((z - t) / a), x);
} else if (t_1 <= 2e+28) {
tmp = x + y;
} else {
tmp = (z - t) * (y / (a - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (t_1 <= -1e+131) tmp = Float64(y * Float64(z / Float64(a - t))); elseif (t_1 <= -1e+50) tmp = Float64(x + Float64(-Float64(y * Float64(z / t)))); elseif (t_1 <= 5e-6) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (t_1 <= 2e+28) tmp = Float64(x + y); else tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+50], N[(x + (-N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, 5e-6], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+28], N[(x + y), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+50}:\\
\;\;\;\;x + \left(-y \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -9.9999999999999991e130Initial program 91.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6473.3
Applied rewrites73.3%
if -9.9999999999999991e130 < (/.f64 (-.f64 z t) (-.f64 a t)) < -1.0000000000000001e50Initial program 99.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6455.7
Applied rewrites55.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.3
Applied rewrites59.3%
if -1.0000000000000001e50 < (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000041e-6Initial program 99.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6495.2
Applied rewrites95.2%
if 5.00000000000000041e-6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999992e28Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites95.3%
if 1.99999999999999992e28 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 95.0%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6468.6
Applied rewrites68.6%
sub-div68.6
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6473.1
Applied rewrites73.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (* y (/ z (- a t)))))
(if (<= t_1 -1e+131)
t_2
(if (<= t_1 -1e+50)
(+ x (- (* y (/ z t))))
(if (<= t_1 5e-6)
(fma y (/ (- z t) a) x)
(if (<= t_1 2e+28) (+ x y) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = y * (z / (a - t));
double tmp;
if (t_1 <= -1e+131) {
tmp = t_2;
} else if (t_1 <= -1e+50) {
tmp = x + -(y * (z / t));
} else if (t_1 <= 5e-6) {
tmp = fma(y, ((z - t) / a), x);
} else if (t_1 <= 2e+28) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(y * Float64(z / Float64(a - t))) tmp = 0.0 if (t_1 <= -1e+131) tmp = t_2; elseif (t_1 <= -1e+50) tmp = Float64(x + Float64(-Float64(y * Float64(z / t)))); elseif (t_1 <= 5e-6) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (t_1 <= 2e+28) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], t$95$2, If[LessEqual[t$95$1, -1e+50], N[(x + (-N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, 5e-6], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+28], N[(x + y), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot \frac{z}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+50}:\\
\;\;\;\;x + \left(-y \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -9.9999999999999991e130 or 1.99999999999999992e28 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 93.9%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6472.1
Applied rewrites72.1%
if -9.9999999999999991e130 < (/.f64 (-.f64 z t) (-.f64 a t)) < -1.0000000000000001e50Initial program 99.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6455.7
Applied rewrites55.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.3
Applied rewrites59.3%
if -1.0000000000000001e50 < (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000041e-6Initial program 99.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6495.2
Applied rewrites95.2%
if 5.00000000000000041e-6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999992e28Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites95.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (* y (/ z (- a t)))))
(if (<= t_1 -1e+131)
t_2
(if (<= t_1 -2000000.0)
(+ x (- (* y (/ z t))))
(if (<= t_1 5e-6)
(fma y (/ (- t) a) x)
(if (<= t_1 2e+28) (+ x y) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = y * (z / (a - t));
double tmp;
if (t_1 <= -1e+131) {
tmp = t_2;
} else if (t_1 <= -2000000.0) {
tmp = x + -(y * (z / t));
} else if (t_1 <= 5e-6) {
tmp = fma(y, (-t / a), x);
} else if (t_1 <= 2e+28) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(y * Float64(z / Float64(a - t))) tmp = 0.0 if (t_1 <= -1e+131) tmp = t_2; elseif (t_1 <= -2000000.0) tmp = Float64(x + Float64(-Float64(y * Float64(z / t)))); elseif (t_1 <= 5e-6) tmp = fma(y, Float64(Float64(-t) / a), x); elseif (t_1 <= 2e+28) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], t$95$2, If[LessEqual[t$95$1, -2000000.0], N[(x + (-N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, 5e-6], N[(y * N[((-t) / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+28], N[(x + y), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot \frac{z}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -2000000:\\
\;\;\;\;x + \left(-y \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -9.9999999999999991e130 or 1.99999999999999992e28 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 93.9%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6472.1
Applied rewrites72.1%
if -9.9999999999999991e130 < (/.f64 (-.f64 z t) (-.f64 a t)) < -2e6Initial program 99.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.0
Applied rewrites56.0%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.9
Applied rewrites60.9%
if -2e6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000041e-6Initial program 99.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6498.2
Applied rewrites98.2%
Taylor expanded in z around 0
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6483.9
Applied rewrites83.9%
if 5.00000000000000041e-6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999992e28Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites95.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (* y (/ z (- a t)))))
(if (<= t_1 -2e+53)
t_2
(if (<= t_1 5e-6)
(fma y (/ (- t) a) x)
(if (<= t_1 2e+28) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = y * (z / (a - t));
double tmp;
if (t_1 <= -2e+53) {
tmp = t_2;
} else if (t_1 <= 5e-6) {
tmp = fma(y, (-t / a), x);
} else if (t_1 <= 2e+28) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(y * Float64(z / Float64(a - t))) tmp = 0.0 if (t_1 <= -2e+53) tmp = t_2; elseif (t_1 <= 5e-6) tmp = fma(y, Float64(Float64(-t) / a), x); elseif (t_1 <= 2e+28) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+53], t$95$2, If[LessEqual[t$95$1, 5e-6], N[(y * N[((-t) / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+28], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot \frac{z}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -2e53 or 1.99999999999999992e28 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.9%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6470.7
Applied rewrites70.7%
if -2e53 < (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000041e-6Initial program 99.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6495.1
Applied rewrites95.1%
Taylor expanded in z around 0
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6480.2
Applied rewrites80.2%
if 5.00000000000000041e-6 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999992e28Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites95.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (* y (/ z (- a t)))))
(if (<= t_1 -1e+94)
t_2
(if (<= t_1 2e-51) (fma y (/ z a) x) (if (<= t_1 2e+28) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = y * (z / (a - t));
double tmp;
if (t_1 <= -1e+94) {
tmp = t_2;
} else if (t_1 <= 2e-51) {
tmp = fma(y, (z / a), x);
} else if (t_1 <= 2e+28) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(y * Float64(z / Float64(a - t))) tmp = 0.0 if (t_1 <= -1e+94) tmp = t_2; elseif (t_1 <= 2e-51) tmp = fma(y, Float64(z / a), x); elseif (t_1 <= 2e+28) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+94], t$95$2, If[LessEqual[t$95$1, 2e-51], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+28], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot \frac{z}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+94}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -1e94 or 1.99999999999999992e28 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.4%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6471.3
Applied rewrites71.3%
if -1e94 < (/.f64 (-.f64 z t) (-.f64 a t)) < 2e-51Initial program 99.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
if 2e-51 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999992e28Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites91.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ z a) x)) (t_2 (/ (- z t) (- a t))))
(if (<= t_2 -4e+163)
(/ (* (- y) z) t)
(if (<= t_2 2e-51) t_1 (if (<= t_2 1000000000.0) (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (z / a), x);
double t_2 = (z - t) / (a - t);
double tmp;
if (t_2 <= -4e+163) {
tmp = (-y * z) / t;
} else if (t_2 <= 2e-51) {
tmp = t_1;
} else if (t_2 <= 1000000000.0) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(z / a), x) t_2 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (t_2 <= -4e+163) tmp = Float64(Float64(Float64(-y) * z) / t); elseif (t_2 <= 2e-51) tmp = t_1; elseif (t_2 <= 1000000000.0) tmp = Float64(x + y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+163], N[(N[((-y) * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$2, 2e-51], t$95$1, If[LessEqual[t$95$2, 1000000000.0], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
t_2 := \frac{z - t}{a - t}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+163}:\\
\;\;\;\;\frac{\left(-y\right) \cdot z}{t}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 1000000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -3.9999999999999998e163Initial program 89.9%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6475.7
Applied rewrites75.7%
Taylor expanded in t around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6454.0
Applied rewrites54.0%
if -3.9999999999999998e163 < (/.f64 (-.f64 z t) (-.f64 a t)) < 2e-51 or 1e9 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 98.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.9
Applied rewrites74.9%
if 2e-51 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1e9Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites92.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (/ (* (- y) z) t)))
(if (<= t_1 -1e+94)
t_2
(if (<= t_1 2e-51) x (if (<= t_1 1e+116) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = (-y * z) / t;
double tmp;
if (t_1 <= -1e+94) {
tmp = t_2;
} else if (t_1 <= 2e-51) {
tmp = x;
} else if (t_1 <= 1e+116) {
tmp = x + y;
} 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 = (z - t) / (a - t)
t_2 = (-y * z) / t
if (t_1 <= (-1d+94)) then
tmp = t_2
else if (t_1 <= 2d-51) then
tmp = x
else if (t_1 <= 1d+116) then
tmp = x + y
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 = (z - t) / (a - t);
double t_2 = (-y * z) / t;
double tmp;
if (t_1 <= -1e+94) {
tmp = t_2;
} else if (t_1 <= 2e-51) {
tmp = x;
} else if (t_1 <= 1e+116) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = (-y * z) / t tmp = 0 if t_1 <= -1e+94: tmp = t_2 elif t_1 <= 2e-51: tmp = x elif t_1 <= 1e+116: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(Float64(Float64(-y) * z) / t) tmp = 0.0 if (t_1 <= -1e+94) tmp = t_2; elseif (t_1 <= 2e-51) tmp = x; elseif (t_1 <= 1e+116) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = (-y * z) / t; tmp = 0.0; if (t_1 <= -1e+94) tmp = t_2; elseif (t_1 <= 2e-51) tmp = x; elseif (t_1 <= 1e+116) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-y) * z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+94], t$95$2, If[LessEqual[t$95$1, 2e-51], x, If[LessEqual[t$95$1, 1e+116], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := \frac{\left(-y\right) \cdot z}{t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+94}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+116}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -1e94 or 1.00000000000000002e116 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.9%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6473.0
Applied rewrites73.0%
Taylor expanded in t around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6447.7
Applied rewrites47.7%
if -1e94 < (/.f64 (-.f64 z t) (-.f64 a t)) < 2e-51Initial program 99.2%
Taylor expanded in x around inf
Applied rewrites68.1%
if 2e-51 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.00000000000000002e116Initial program 99.9%
Taylor expanded in t around inf
Applied rewrites85.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))))
(if (<= t_1 -1e+131)
(/ (* z y) a)
(if (<= t_1 2e-51) x (if (<= t_1 1e+116) (+ x y) (* y (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= -1e+131) {
tmp = (z * y) / a;
} else if (t_1 <= 2e-51) {
tmp = x;
} else if (t_1 <= 1e+116) {
tmp = x + y;
} else {
tmp = y * (z / a);
}
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 - t) / (a - t)
if (t_1 <= (-1d+131)) then
tmp = (z * y) / a
else if (t_1 <= 2d-51) then
tmp = x
else if (t_1 <= 1d+116) then
tmp = x + y
else
tmp = y * (z / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= -1e+131) {
tmp = (z * y) / a;
} else if (t_1 <= 2e-51) {
tmp = x;
} else if (t_1 <= 1e+116) {
tmp = x + y;
} else {
tmp = y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) tmp = 0 if t_1 <= -1e+131: tmp = (z * y) / a elif t_1 <= 2e-51: tmp = x elif t_1 <= 1e+116: tmp = x + y else: tmp = y * (z / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (t_1 <= -1e+131) tmp = Float64(Float64(z * y) / a); elseif (t_1 <= 2e-51) tmp = x; elseif (t_1 <= 1e+116) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); tmp = 0.0; if (t_1 <= -1e+131) tmp = (z * y) / a; elseif (t_1 <= 2e-51) tmp = x; elseif (t_1 <= 1e+116) tmp = x + y; else tmp = y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 2e-51], x, If[LessEqual[t$95$1, 1e+116], N[(x + y), $MachinePrecision], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+116}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -9.9999999999999991e130Initial program 91.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6473.3
Applied rewrites73.3%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6447.8
Applied rewrites47.8%
if -9.9999999999999991e130 < (/.f64 (-.f64 z t) (-.f64 a t)) < 2e-51Initial program 99.2%
Taylor expanded in x around inf
Applied rewrites66.5%
if 2e-51 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.00000000000000002e116Initial program 99.9%
Taylor expanded in t around inf
Applied rewrites85.0%
if 1.00000000000000002e116 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.2%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.9
Applied rewrites74.9%
Taylor expanded in t around 0
Applied rewrites47.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (/ (* z y) a)))
(if (<= t_1 -1e+131)
t_2
(if (<= t_1 2e-51) x (if (<= t_1 1e+116) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = (z * y) / a;
double tmp;
if (t_1 <= -1e+131) {
tmp = t_2;
} else if (t_1 <= 2e-51) {
tmp = x;
} else if (t_1 <= 1e+116) {
tmp = x + y;
} 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 = (z - t) / (a - t)
t_2 = (z * y) / a
if (t_1 <= (-1d+131)) then
tmp = t_2
else if (t_1 <= 2d-51) then
tmp = x
else if (t_1 <= 1d+116) then
tmp = x + y
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 = (z - t) / (a - t);
double t_2 = (z * y) / a;
double tmp;
if (t_1 <= -1e+131) {
tmp = t_2;
} else if (t_1 <= 2e-51) {
tmp = x;
} else if (t_1 <= 1e+116) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = (z * y) / a tmp = 0 if t_1 <= -1e+131: tmp = t_2 elif t_1 <= 2e-51: tmp = x elif t_1 <= 1e+116: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(Float64(z * y) / a) tmp = 0.0 if (t_1 <= -1e+131) tmp = t_2; elseif (t_1 <= 2e-51) tmp = x; elseif (t_1 <= 1e+116) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = (z * y) / a; tmp = 0.0; if (t_1 <= -1e+131) tmp = t_2; elseif (t_1 <= 2e-51) tmp = x; elseif (t_1 <= 1e+116) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], t$95$2, If[LessEqual[t$95$1, 2e-51], x, If[LessEqual[t$95$1, 1e+116], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := \frac{z \cdot y}{a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+116}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -9.9999999999999991e130 or 1.00000000000000002e116 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.0%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6474.2
Applied rewrites74.2%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6448.0
Applied rewrites48.0%
if -9.9999999999999991e130 < (/.f64 (-.f64 z t) (-.f64 a t)) < 2e-51Initial program 99.2%
Taylor expanded in x around inf
Applied rewrites66.5%
if 2e-51 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.00000000000000002e116Initial program 99.9%
Taylor expanded in t around inf
Applied rewrites85.0%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (- z t) (- a t)) 2.1e-36) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - t) / (a - t)) <= 2.1e-36) {
tmp = x;
} else {
tmp = x + 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 (((z - t) / (a - t)) <= 2.1d-36) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - t) / (a - t)) <= 2.1e-36) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((z - t) / (a - t)) <= 2.1e-36: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(z - t) / Float64(a - t)) <= 2.1e-36) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((z - t) / (a - t)) <= 2.1e-36) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], 2.1e-36], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z - t}{a - t} \leq 2.1 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 2.09999999999999991e-36Initial program 98.0%
Taylor expanded in x around inf
Applied rewrites58.9%
if 2.09999999999999991e-36 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 98.6%
Taylor expanded in t around inf
Applied rewrites74.9%
(FPCore (x y z t a) :precision binary64 (if (<= y 5.7e+47) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 5.7e+47) {
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 <= 5.7d+47) 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 <= 5.7e+47) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 5.7e+47: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 5.7e+47) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 5.7e+47) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 5.7e+47], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.7 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 5.6999999999999997e47Initial program 98.0%
Taylor expanded in x around inf
Applied rewrites57.5%
if 5.6999999999999997e47 < y Initial program 99.4%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6447.3
Applied rewrites47.3%
Taylor expanded in t around 0
Applied rewrites29.9%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6411.0
Applied rewrites11.0%
Taylor expanded in t around inf
Applied rewrites28.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 98.3%
Taylor expanded in x around inf
Applied rewrites51.2%
herbie shell --seed 2025114
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
(+ x (* y (/ (- z t) (- a t)))))