
(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 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_2 -2e-116)
t_1
(if (<= t_2 2e-277) (+ (- (/ (- (* a y) (* z y)) t)) x) t_1))))
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 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -2e-116) {
tmp = t_1;
} else if (t_2 <= 2e-277) {
tmp = -(((a * y) - (z * 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 - ((z - t) * (y / (a - t))))
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 <= (-2d-116)) then
tmp = t_1
else if (t_2 <= 2d-277) then
tmp = -(((a * y) - (z * 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 - ((z - t) * (y / (a - t))));
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -2e-116) {
tmp = t_1;
} else if (t_2 <= 2e-277) {
tmp = -(((a * y) - (z * y)) / t) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - ((z - t) * (y / (a - t)))) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 <= -2e-116: tmp = t_1 elif t_2 <= 2e-277: tmp = -(((a * y) - (z * y)) / t) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - Float64(Float64(z - t) * Float64(y / Float64(a - t))))) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-116) tmp = t_1; elseif (t_2 <= 2e-277) tmp = Float64(Float64(-Float64(Float64(Float64(a * y) - Float64(z * y)) / t)) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - ((z - t) * (y / (a - t)))); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 <= -2e-116) tmp = t_1; elseif (t_2 <= 2e-277) tmp = -(((a * y) - (z * y)) / t) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $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, -2e-116], t$95$1, If[LessEqual[t$95$2, 2e-277], N[((-N[(N[(N[(a * y), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - \left(z - t\right) \cdot \frac{y}{a - t}\right)\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-277}:\\
\;\;\;\;\left(-\frac{a \cdot y - z \cdot y}{t}\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-116 or 1.99999999999999994e-277 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 76.8%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6486.3
Applied rewrites86.3%
if -2e-116 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.99999999999999994e-277Initial program 76.8%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.9
Applied rewrites57.9%
(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 -2e-116)
t_1
(if (<= t_2 2e-277) (+ (- (/ (- (* a y) (* z 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 <= -2e-116) {
tmp = t_1;
} else if (t_2 <= 2e-277) {
tmp = -(((a * y) - (z * 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 <= (-2d-116)) then
tmp = t_1
else if (t_2 <= 2d-277) then
tmp = -(((a * y) - (z * 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 <= -2e-116) {
tmp = t_1;
} else if (t_2 <= 2e-277) {
tmp = -(((a * y) - (z * 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 <= -2e-116: tmp = t_1 elif t_2 <= 2e-277: tmp = -(((a * y) - (z * 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 <= -2e-116) tmp = t_1; elseif (t_2 <= 2e-277) tmp = Float64(Float64(-Float64(Float64(Float64(a * y) - Float64(z * 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 <= -2e-116) tmp = t_1; elseif (t_2 <= 2e-277) tmp = -(((a * y) - (z * 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, -2e-116], t$95$1, If[LessEqual[t$95$2, 2e-277], N[((-N[(N[(N[(a * y), $MachinePrecision] - N[(z * 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 -2 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-277}:\\
\;\;\;\;\left(-\frac{a \cdot y - z \cdot y}{t}\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-116 or 1.99999999999999994e-277 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 76.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6481.5
Applied rewrites81.5%
if -2e-116 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.99999999999999994e-277Initial program 76.8%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.9
Applied rewrites57.9%
(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-277)
t_1
(if (<= t_2 0.0) (* -1.0 (/ (* y (- a z)) t)) 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-277) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = -1.0 * ((y * (a - z)) / t);
} 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-277)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = (-1.0d0) * ((y * (a - z)) / t)
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-277) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = -1.0 * ((y * (a - z)) / t);
} 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-277: tmp = t_1 elif t_2 <= 0.0: tmp = -1.0 * ((y * (a - z)) / t) 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-277) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(-1.0 * Float64(Float64(y * Float64(a - z)) / t)); 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-277) tmp = t_1; elseif (t_2 <= 0.0) tmp = -1.0 * ((y * (a - z)) / t); 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-277], t$95$1, If[LessEqual[t$95$2, 0.0], N[(-1.0 * N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $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^{-277}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5e-277 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 76.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6481.5
Applied rewrites81.5%
if -5e-277 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t))))
(t_2 (- (+ x y) (/ (* z y) a))))
(if (<= t_1 (- INFINITY))
(- y (* y (/ z (- a t))))
(if (<= t_1 -5e-198)
t_2
(if (<= t_1 0.0)
(* -1.0 (/ (* y (- a z)) t))
(if (<= t_1 4e+301) t_2 (- y (* (- z t) (/ y (- a t))))))))))
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 = (x + y) - ((z * y) / a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y - (y * (z / (a - t)));
} else if (t_1 <= -5e-198) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = -1.0 * ((y * (a - z)) / t);
} else if (t_1 <= 4e+301) {
tmp = t_2;
} else {
tmp = y - ((z - t) * (y / (a - t)));
}
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 = (x + y) - ((z * y) / a);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y - (y * (z / (a - t)));
} else if (t_1 <= -5e-198) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = -1.0 * ((y * (a - z)) / t);
} else if (t_1 <= 4e+301) {
tmp = t_2;
} else {
tmp = y - ((z - t) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (((z - t) * y) / (a - t)) t_2 = (x + y) - ((z * y) / a) tmp = 0 if t_1 <= -math.inf: tmp = y - (y * (z / (a - t))) elif t_1 <= -5e-198: tmp = t_2 elif t_1 <= 0.0: tmp = -1.0 * ((y * (a - z)) / t) elif t_1 <= 4e+301: tmp = t_2 else: tmp = y - ((z - t) * (y / (a - t))) 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(Float64(x + y) - Float64(Float64(z * y) / a)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y - Float64(y * Float64(z / Float64(a - t)))); elseif (t_1 <= -5e-198) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(-1.0 * Float64(Float64(y * Float64(a - z)) / t)); elseif (t_1 <= 4e+301) tmp = t_2; else tmp = Float64(y - Float64(Float64(z - t) * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (((z - t) * y) / (a - t)); t_2 = (x + y) - ((z * y) / a); tmp = 0.0; if (t_1 <= -Inf) tmp = y - (y * (z / (a - t))); elseif (t_1 <= -5e-198) tmp = t_2; elseif (t_1 <= 0.0) tmp = -1.0 * ((y * (a - z)) / t); elseif (t_1 <= 4e+301) tmp = t_2; else tmp = y - ((z - t) * (y / (a - t))); 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[(N[(x + y), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-198], t$95$2, If[LessEqual[t$95$1, 0.0], N[(-1.0 * N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+301], t$95$2, N[(y - N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $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 := \left(x + y\right) - \frac{z \cdot y}{a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y - y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-198}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;-1 \cdot \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;y - \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 76.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6481.5
Applied rewrites81.5%
Taylor expanded in x around 0
Applied rewrites39.6%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.9999999999999999e-198 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 4.00000000000000021e301Initial program 76.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.3
Applied rewrites64.3%
if -4.9999999999999999e-198 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6422.7
Applied rewrites22.7%
if 4.00000000000000021e301 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 76.8%
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--.f6439.9
Applied rewrites39.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ z (- a t)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t))))
(t_3 (- (+ x y) (/ (* z y) a))))
(if (<= t_2 (- INFINITY))
(- y (* y t_1))
(if (<= t_2 -5e-198)
t_3
(if (<= t_2 0.0)
(* -1.0 (/ (* y (- a z)) t))
(if (<= t_2 4e+301) t_3 (* (- 1.0 t_1) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z / (a - t);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double t_3 = (x + y) - ((z * y) / a);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y - (y * t_1);
} else if (t_2 <= -5e-198) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = -1.0 * ((y * (a - z)) / t);
} else if (t_2 <= 4e+301) {
tmp = t_3;
} else {
tmp = (1.0 - t_1) * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z / (a - t);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double t_3 = (x + y) - ((z * y) / a);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y - (y * t_1);
} else if (t_2 <= -5e-198) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = -1.0 * ((y * (a - z)) / t);
} else if (t_2 <= 4e+301) {
tmp = t_3;
} else {
tmp = (1.0 - t_1) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z / (a - t) t_2 = (x + y) - (((z - t) * y) / (a - t)) t_3 = (x + y) - ((z * y) / a) tmp = 0 if t_2 <= -math.inf: tmp = y - (y * t_1) elif t_2 <= -5e-198: tmp = t_3 elif t_2 <= 0.0: tmp = -1.0 * ((y * (a - z)) / t) elif t_2 <= 4e+301: tmp = t_3 else: tmp = (1.0 - t_1) * y return tmp
function code(x, y, z, t, a) t_1 = Float64(z / Float64(a - t)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) t_3 = Float64(Float64(x + y) - Float64(Float64(z * y) / a)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y - Float64(y * t_1)); elseif (t_2 <= -5e-198) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(-1.0 * Float64(Float64(y * Float64(a - z)) / t)); elseif (t_2 <= 4e+301) tmp = t_3; else tmp = Float64(Float64(1.0 - t_1) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z / (a - t); t_2 = (x + y) - (((z - t) * y) / (a - t)); t_3 = (x + y) - ((z * y) / a); tmp = 0.0; if (t_2 <= -Inf) tmp = y - (y * t_1); elseif (t_2 <= -5e-198) tmp = t_3; elseif (t_2 <= 0.0) tmp = -1.0 * ((y * (a - z)) / t); elseif (t_2 <= 4e+301) tmp = t_3; else tmp = (1.0 - t_1) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z / N[(a - t), $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]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y - N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-198], t$95$3, If[LessEqual[t$95$2, 0.0], N[(-1.0 * N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+301], t$95$3, N[(N[(1.0 - t$95$1), $MachinePrecision] * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{a - t}\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_3 := \left(x + y\right) - \frac{z \cdot y}{a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;y - y \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-198}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+301}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\_1\right) \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 76.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6481.5
Applied rewrites81.5%
Taylor expanded in x around 0
Applied rewrites39.6%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.9999999999999999e-198 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 4.00000000000000021e301Initial program 76.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.3
Applied rewrites64.3%
if -4.9999999999999999e-198 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6422.7
Applied rewrites22.7%
if 4.00000000000000021e301 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around 0
Applied rewrites39.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* z y) a))))
(if (<= a -1.9e-29)
t_1
(if (<= a 7.2e-84) (- (+ x y) (* y (- 1.0 (/ z t)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((z * y) / a);
double tmp;
if (a <= -1.9e-29) {
tmp = t_1;
} else if (a <= 7.2e-84) {
tmp = (x + y) - (y * (1.0 - (z / t)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x + y) - ((z * y) / a)
if (a <= (-1.9d-29)) then
tmp = t_1
else if (a <= 7.2d-84) then
tmp = (x + y) - (y * (1.0d0 - (z / t)))
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) - ((z * y) / a);
double tmp;
if (a <= -1.9e-29) {
tmp = t_1;
} else if (a <= 7.2e-84) {
tmp = (x + y) - (y * (1.0 - (z / t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((z * y) / a) tmp = 0 if a <= -1.9e-29: tmp = t_1 elif a <= 7.2e-84: tmp = (x + y) - (y * (1.0 - (z / t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(z * y) / a)) tmp = 0.0 if (a <= -1.9e-29) tmp = t_1; elseif (a <= 7.2e-84) tmp = Float64(Float64(x + y) - Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((z * y) / a); tmp = 0.0; if (a <= -1.9e-29) tmp = t_1; elseif (a <= 7.2e-84) tmp = (x + y) - (y * (1.0 - (z / t))); 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[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.9e-29], t$95$1, If[LessEqual[a, 7.2e-84], N[(N[(x + y), $MachinePrecision] - N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{z \cdot y}{a}\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-84}:\\
\;\;\;\;\left(x + y\right) - y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.89999999999999988e-29 or 7.20000000000000007e-84 < a Initial program 76.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.3
Applied rewrites64.3%
if -1.89999999999999988e-29 < a < 7.20000000000000007e-84Initial program 76.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-/.f6452.0
Applied rewrites52.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ z (- a t))) (t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_2 (- INFINITY))
(- y (* y t_1))
(if (<= t_2 4e+301) (- (+ x y) (/ (* z y) a)) (* (- 1.0 t_1) y)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z / (a - t);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y - (y * t_1);
} else if (t_2 <= 4e+301) {
tmp = (x + y) - ((z * y) / a);
} else {
tmp = (1.0 - t_1) * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z / (a - t);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y - (y * t_1);
} else if (t_2 <= 4e+301) {
tmp = (x + y) - ((z * y) / a);
} else {
tmp = (1.0 - t_1) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z / (a - t) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 <= -math.inf: tmp = y - (y * t_1) elif t_2 <= 4e+301: tmp = (x + y) - ((z * y) / a) else: tmp = (1.0 - t_1) * y return tmp
function code(x, y, z, t, a) t_1 = 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(y - Float64(y * t_1)); elseif (t_2 <= 4e+301) tmp = Float64(Float64(x + y) - Float64(Float64(z * y) / a)); else tmp = Float64(Float64(1.0 - t_1) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z / (a - t); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 <= -Inf) tmp = y - (y * t_1); elseif (t_2 <= 4e+301) tmp = (x + y) - ((z * y) / a); else tmp = (1.0 - t_1) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z / N[(a - t), $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[(y - N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+301], N[(N[(x + y), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$1), $MachinePrecision] * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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:\\
\;\;\;\;y - y \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+301}:\\
\;\;\;\;\left(x + y\right) - \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\_1\right) \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 76.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6481.5
Applied rewrites81.5%
Taylor expanded in x around 0
Applied rewrites39.6%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 4.00000000000000021e301Initial program 76.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.3
Applied rewrites64.3%
if 4.00000000000000021e301 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around 0
Applied rewrites39.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ z (- a t))))
(if (<= y -2.4e+36)
(- y (* y t_1))
(if (<= y 2.45e-11) (- (+ x y) (* y 1.0)) (* (- 1.0 t_1) y)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z / (a - t);
double tmp;
if (y <= -2.4e+36) {
tmp = y - (y * t_1);
} else if (y <= 2.45e-11) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = (1.0 - t_1) * 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) :: t_1
real(8) :: tmp
t_1 = z / (a - t)
if (y <= (-2.4d+36)) then
tmp = y - (y * t_1)
else if (y <= 2.45d-11) then
tmp = (x + y) - (y * 1.0d0)
else
tmp = (1.0d0 - t_1) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z / (a - t);
double tmp;
if (y <= -2.4e+36) {
tmp = y - (y * t_1);
} else if (y <= 2.45e-11) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = (1.0 - t_1) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z / (a - t) tmp = 0 if y <= -2.4e+36: tmp = y - (y * t_1) elif y <= 2.45e-11: tmp = (x + y) - (y * 1.0) else: tmp = (1.0 - t_1) * y return tmp
function code(x, y, z, t, a) t_1 = Float64(z / Float64(a - t)) tmp = 0.0 if (y <= -2.4e+36) tmp = Float64(y - Float64(y * t_1)); elseif (y <= 2.45e-11) tmp = Float64(Float64(x + y) - Float64(y * 1.0)); else tmp = Float64(Float64(1.0 - t_1) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z / (a - t); tmp = 0.0; if (y <= -2.4e+36) tmp = y - (y * t_1); elseif (y <= 2.45e-11) tmp = (x + y) - (y * 1.0); else tmp = (1.0 - t_1) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+36], N[(y - N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e-11], N[(N[(x + y), $MachinePrecision] - N[(y * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$1), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{a - t}\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+36}:\\
\;\;\;\;y - y \cdot t\_1\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-11}:\\
\;\;\;\;\left(x + y\right) - y \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\_1\right) \cdot y\\
\end{array}
\end{array}
if y < -2.39999999999999992e36Initial program 76.8%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6481.5
Applied rewrites81.5%
Taylor expanded in x around 0
Applied rewrites39.6%
if -2.39999999999999992e36 < y < 2.4499999999999999e-11Initial program 76.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-/.f6452.0
Applied rewrites52.0%
Taylor expanded in z around 0
Applied rewrites44.9%
if 2.4499999999999999e-11 < y Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around 0
Applied rewrites39.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (- 1.0 (/ z (- a t))) y))) (if (<= y -2.4e+36) t_1 (if (<= y 2.45e-11) (- (+ x y) (* y 1.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (z / (a - t))) * y;
double tmp;
if (y <= -2.4e+36) {
tmp = t_1;
} else if (y <= 2.45e-11) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - (z / (a - t))) * y
if (y <= (-2.4d+36)) then
tmp = t_1
else if (y <= 2.45d-11) then
tmp = (x + y) - (y * 1.0d0)
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 = (1.0 - (z / (a - t))) * y;
double tmp;
if (y <= -2.4e+36) {
tmp = t_1;
} else if (y <= 2.45e-11) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (1.0 - (z / (a - t))) * y tmp = 0 if y <= -2.4e+36: tmp = t_1 elif y <= 2.45e-11: tmp = (x + y) - (y * 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(1.0 - Float64(z / Float64(a - t))) * y) tmp = 0.0 if (y <= -2.4e+36) tmp = t_1; elseif (y <= 2.45e-11) tmp = Float64(Float64(x + y) - Float64(y * 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (1.0 - (z / (a - t))) * y; tmp = 0.0; if (y <= -2.4e+36) tmp = t_1; elseif (y <= 2.45e-11) tmp = (x + y) - (y * 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(1.0 - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.4e+36], t$95$1, If[LessEqual[y, 2.45e-11], N[(N[(x + y), $MachinePrecision] - N[(y * 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \frac{z}{a - t}\right) \cdot y\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-11}:\\
\;\;\;\;\left(x + y\right) - y \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.39999999999999992e36 or 2.4499999999999999e-11 < y Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around 0
Applied rewrites39.6%
if -2.39999999999999992e36 < y < 2.4499999999999999e-11Initial program 76.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-/.f6452.0
Applied rewrites52.0%
Taylor expanded in z around 0
Applied rewrites44.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (- 1.0 (/ z a)) y))) (if (<= y -4.2e+39) t_1 (if (<= y 5.6e+78) (- (+ x y) (* y 1.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (z / a)) * y;
double tmp;
if (y <= -4.2e+39) {
tmp = t_1;
} else if (y <= 5.6e+78) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - (z / a)) * y
if (y <= (-4.2d+39)) then
tmp = t_1
else if (y <= 5.6d+78) then
tmp = (x + y) - (y * 1.0d0)
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 = (1.0 - (z / a)) * y;
double tmp;
if (y <= -4.2e+39) {
tmp = t_1;
} else if (y <= 5.6e+78) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (1.0 - (z / a)) * y tmp = 0 if y <= -4.2e+39: tmp = t_1 elif y <= 5.6e+78: tmp = (x + y) - (y * 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(1.0 - Float64(z / a)) * y) tmp = 0.0 if (y <= -4.2e+39) tmp = t_1; elseif (y <= 5.6e+78) tmp = Float64(Float64(x + y) - Float64(y * 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (1.0 - (z / a)) * y; tmp = 0.0; if (y <= -4.2e+39) tmp = t_1; elseif (y <= 5.6e+78) tmp = (x + y) - (y * 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4.2e+39], t$95$1, If[LessEqual[y, 5.6e+78], N[(N[(x + y), $MachinePrecision] - N[(y * 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \frac{z}{a}\right) \cdot y\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+78}:\\
\;\;\;\;\left(x + y\right) - y \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.1999999999999997e39 or 5.6000000000000002e78 < y Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in t around 0
lower--.f64N/A
lower-/.f6431.0
Applied rewrites31.0%
if -4.1999999999999997e39 < y < 5.6000000000000002e78Initial program 76.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-/.f6452.0
Applied rewrites52.0%
Taylor expanded in z around 0
Applied rewrites44.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ z t) y))) (if (<= y -3.6e+30) t_1 (if (<= y 1.8e+86) (- (+ x y) (* y 1.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z / t) * y;
double tmp;
if (y <= -3.6e+30) {
tmp = t_1;
} else if (y <= 1.8e+86) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z / t) * y
if (y <= (-3.6d+30)) then
tmp = t_1
else if (y <= 1.8d+86) then
tmp = (x + y) - (y * 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z / t) * y;
double tmp;
if (y <= -3.6e+30) {
tmp = t_1;
} else if (y <= 1.8e+86) {
tmp = (x + y) - (y * 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z / t) * y tmp = 0 if y <= -3.6e+30: tmp = t_1 elif y <= 1.8e+86: tmp = (x + y) - (y * 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z / t) * y) tmp = 0.0 if (y <= -3.6e+30) tmp = t_1; elseif (y <= 1.8e+86) tmp = Float64(Float64(x + y) - Float64(y * 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z / t) * y; tmp = 0.0; if (y <= -3.6e+30) tmp = t_1; elseif (y <= 1.8e+86) tmp = (x + y) - (y * 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.6e+30], t$95$1, If[LessEqual[y, 1.8e+86], N[(N[(x + y), $MachinePrecision] - N[(y * 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+86}:\\
\;\;\;\;\left(x + y\right) - y \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.6000000000000002e30 or 1.80000000000000003e86 < y Initial program 76.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6445.0
Applied rewrites45.0%
Taylor expanded in a around 0
lower-/.f6420.3
Applied rewrites20.3%
if -3.6000000000000002e30 < y < 1.80000000000000003e86Initial program 76.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-/.f6452.0
Applied rewrites52.0%
Taylor expanded in z around 0
Applied rewrites44.9%
(FPCore (x y z t a) :precision binary64 (/ (* y z) t))
double code(double x, double y, double z, double t, double a) {
return (y * z) / 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 = (y * z) / t
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * z) / t;
}
def code(x, y, z, t, a): return (y * z) / t
function code(x, y, z, t, a) return Float64(Float64(y * z) / t) end
function tmp = code(x, y, z, t, a) tmp = (y * z) / t; end
code[x_, y_, z_, t_, a_] := N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot z}{t}
\end{array}
Initial program 76.8%
Taylor expanded in z around inf
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6426.4
Applied rewrites26.4%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f6418.8
Applied rewrites18.8%
herbie shell --seed 2025140
(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))))