
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- z t) (- a t)) (- y x))))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -2e-274)
t_1
(if (<= t_2 0.0)
(+ y (* -1.0 (/ (- (* z (- y x)) (* a (- y x))) t)))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((z - t) / (a - t)) * (y - x));
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-274) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = y + (-1.0 * (((z * (y - x)) - (a * (y - x))) / 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 + (((z - t) / (a - t)) * (y - x))
t_2 = x + (((y - x) * (z - t)) / (a - t))
if (t_2 <= (-2d-274)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = y + ((-1.0d0) * (((z * (y - x)) - (a * (y - x))) / 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 + (((z - t) / (a - t)) * (y - x));
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-274) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = y + (-1.0 * (((z * (y - x)) - (a * (y - x))) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((z - t) / (a - t)) * (y - x)) t_2 = x + (((y - x) * (z - t)) / (a - t)) tmp = 0 if t_2 <= -2e-274: tmp = t_1 elif t_2 <= 0.0: tmp = y + (-1.0 * (((z * (y - x)) - (a * (y - x))) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(z - t) / Float64(a - t)) * Float64(y - x))) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-274) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(y + Float64(-1.0 * Float64(Float64(Float64(z * Float64(y - x)) - Float64(a * Float64(y - x))) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((z - t) / (a - t)) * (y - x)); t_2 = x + (((y - x) * (z - t)) / (a - t)); tmp = 0.0; if (t_2 <= -2e-274) tmp = t_1; elseif (t_2 <= 0.0) tmp = y + (-1.0 * (((z * (y - x)) - (a * (y - x))) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-274], t$95$1, If[LessEqual[t$95$2, 0.0], N[(y + N[(-1.0 * N[(N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - t}{a - t} \cdot \left(y - x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;y + -1 \cdot \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.99999999999999993e-274 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 69.0%
Applied rewrites84.9%
if -1.99999999999999993e-274 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 69.0%
Taylor expanded in t around -inf
Applied rewrites45.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.2e+202) (+ x (* (/ (- z t) (- a t)) (- y x))) (* y (- (/ z (- a t)) -1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.2e+202) {
tmp = x + (((z - t) / (a - t)) * (y - x));
} else {
tmp = y * ((z / (a - t)) - -1.0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.2d+202) then
tmp = x + (((z - t) / (a - t)) * (y - x))
else
tmp = y * ((z / (a - t)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.2e+202) {
tmp = x + (((z - t) / (a - t)) * (y - x));
} else {
tmp = y * ((z / (a - t)) - -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.2e+202: tmp = x + (((z - t) / (a - t)) * (y - x)) else: tmp = y * ((z / (a - t)) - -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.2e+202) tmp = Float64(x + Float64(Float64(Float64(z - t) / Float64(a - t)) * Float64(y - x))); else tmp = Float64(y * Float64(Float64(z / Float64(a - t)) - -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.2e+202) tmp = x + (((z - t) / (a - t)) * (y - x)); else tmp = y * ((z / (a - t)) - -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.2e+202], N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.2 \cdot 10^{+202}:\\
\;\;\;\;x + \frac{z - t}{a - t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{z}{a - t} - -1\right)\\
\end{array}
\end{array}
if t < 1.2000000000000001e202Initial program 69.0%
Applied rewrites84.9%
if 1.2000000000000001e202 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -9e+185)
(* (/ (- z t) (- a t)) y)
(if (<= t 1.12e+203)
(+ x (* (/ (- y x) (- a t)) (- z t)))
(* y (- (/ z (- a t)) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+185) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 1.12e+203) {
tmp = x + (((y - x) / (a - t)) * (z - t));
} else {
tmp = y * ((z / (a - t)) - -1.0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-9d+185)) then
tmp = ((z - t) / (a - t)) * y
else if (t <= 1.12d+203) then
tmp = x + (((y - x) / (a - t)) * (z - t))
else
tmp = y * ((z / (a - t)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+185) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 1.12e+203) {
tmp = x + (((y - x) / (a - t)) * (z - t));
} else {
tmp = y * ((z / (a - t)) - -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9e+185: tmp = ((z - t) / (a - t)) * y elif t <= 1.12e+203: tmp = x + (((y - x) / (a - t)) * (z - t)) else: tmp = y * ((z / (a - t)) - -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9e+185) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); elseif (t <= 1.12e+203) tmp = Float64(x + Float64(Float64(Float64(y - x) / Float64(a - t)) * Float64(z - t))); else tmp = Float64(y * Float64(Float64(z / Float64(a - t)) - -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9e+185) tmp = ((z - t) / (a - t)) * y; elseif (t <= 1.12e+203) tmp = x + (((y - x) / (a - t)) * (z - t)); else tmp = y * ((z / (a - t)) - -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+185], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.12e+203], N[(x + N[(N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+185}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+203}:\\
\;\;\;\;x + \frac{y - x}{a - t} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{z}{a - t} - -1\right)\\
\end{array}
\end{array}
if t < -9.0000000000000004e185Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Applied rewrites51.6%
if -9.0000000000000004e185 < t < 1.12000000000000006e203Initial program 69.0%
Applied rewrites80.9%
if 1.12000000000000006e203 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.7e-21)
(* (/ (- z t) (- a t)) y)
(if (<= t 5.6e-206)
(+ x (* (/ (- z t) a) (- y x)))
(if (<= t 2.3e+167)
(+ x (/ (* z (- y x)) (- a t)))
(* y (- (/ z (- a t)) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e-21) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 5.6e-206) {
tmp = x + (((z - t) / a) * (y - x));
} else if (t <= 2.3e+167) {
tmp = x + ((z * (y - x)) / (a - t));
} else {
tmp = y * ((z / (a - t)) - -1.0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.7d-21)) then
tmp = ((z - t) / (a - t)) * y
else if (t <= 5.6d-206) then
tmp = x + (((z - t) / a) * (y - x))
else if (t <= 2.3d+167) then
tmp = x + ((z * (y - x)) / (a - t))
else
tmp = y * ((z / (a - t)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e-21) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 5.6e-206) {
tmp = x + (((z - t) / a) * (y - x));
} else if (t <= 2.3e+167) {
tmp = x + ((z * (y - x)) / (a - t));
} else {
tmp = y * ((z / (a - t)) - -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e-21: tmp = ((z - t) / (a - t)) * y elif t <= 5.6e-206: tmp = x + (((z - t) / a) * (y - x)) elif t <= 2.3e+167: tmp = x + ((z * (y - x)) / (a - t)) else: tmp = y * ((z / (a - t)) - -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e-21) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); elseif (t <= 5.6e-206) tmp = Float64(x + Float64(Float64(Float64(z - t) / a) * Float64(y - x))); elseif (t <= 2.3e+167) tmp = Float64(x + Float64(Float64(z * Float64(y - x)) / Float64(a - t))); else tmp = Float64(y * Float64(Float64(z / Float64(a - t)) - -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e-21) tmp = ((z - t) / (a - t)) * y; elseif (t <= 5.6e-206) tmp = x + (((z - t) / a) * (y - x)); elseif (t <= 2.3e+167) tmp = x + ((z * (y - x)) / (a - t)); else tmp = y * ((z / (a - t)) - -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e-21], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 5.6e-206], N[(x + N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e+167], N[(x + N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-206}:\\
\;\;\;\;x + \frac{z - t}{a} \cdot \left(y - x\right)\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+167}:\\
\;\;\;\;x + \frac{z \cdot \left(y - x\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{z}{a - t} - -1\right)\\
\end{array}
\end{array}
if t < -1.7e-21Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Applied rewrites51.6%
if -1.7e-21 < t < 5.6000000000000003e-206Initial program 69.0%
Applied rewrites84.9%
Taylor expanded in a around inf
Applied rewrites53.9%
if 5.6000000000000003e-206 < t < 2.29999999999999988e167Initial program 69.0%
Taylor expanded in z around inf
Applied rewrites55.6%
if 2.29999999999999988e167 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z t) (- a t)) y)))
(if (<= t -1.7e-21)
t_1
(if (<= t 3.1e-28) (+ x (* (/ (- z t) a) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -1.7e-21) {
tmp = t_1;
} else if (t <= 3.1e-28) {
tmp = x + (((z - t) / a) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((z - t) / (a - t)) * y
if (t <= (-1.7d-21)) then
tmp = t_1
else if (t <= 3.1d-28) then
tmp = x + (((z - t) / a) * (y - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -1.7e-21) {
tmp = t_1;
} else if (t <= 3.1e-28) {
tmp = x + (((z - t) / a) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) / (a - t)) * y tmp = 0 if t <= -1.7e-21: tmp = t_1 elif t <= 3.1e-28: tmp = x + (((z - t) / a) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y) tmp = 0.0 if (t <= -1.7e-21) tmp = t_1; elseif (t <= 3.1e-28) tmp = Float64(x + Float64(Float64(Float64(z - t) / a) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) / (a - t)) * y; tmp = 0.0; if (t <= -1.7e-21) tmp = t_1; elseif (t <= 3.1e-28) tmp = x + (((z - t) / a) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -1.7e-21], t$95$1, If[LessEqual[t, 3.1e-28], N[(x + N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-28}:\\
\;\;\;\;x + \frac{z - t}{a} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7e-21 or 3.09999999999999992e-28 < t Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Applied rewrites51.6%
if -1.7e-21 < t < 3.09999999999999992e-28Initial program 69.0%
Applied rewrites84.9%
Taylor expanded in a around inf
Applied rewrites53.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- z t) (- a t)) y))) (if (<= t -4e-19) t_1 (if (<= t 3.6e-84) (+ x (* (/ z a) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -4e-19) {
tmp = t_1;
} else if (t <= 3.6e-84) {
tmp = x + ((z / a) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((z - t) / (a - t)) * y
if (t <= (-4d-19)) then
tmp = t_1
else if (t <= 3.6d-84) then
tmp = x + ((z / a) * (y - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -4e-19) {
tmp = t_1;
} else if (t <= 3.6e-84) {
tmp = x + ((z / a) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) / (a - t)) * y tmp = 0 if t <= -4e-19: tmp = t_1 elif t <= 3.6e-84: tmp = x + ((z / a) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y) tmp = 0.0 if (t <= -4e-19) tmp = t_1; elseif (t <= 3.6e-84) tmp = Float64(x + Float64(Float64(z / a) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) / (a - t)) * y; tmp = 0.0; if (t <= -4e-19) tmp = t_1; elseif (t <= 3.6e-84) tmp = x + ((z / a) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -4e-19], t$95$1, If[LessEqual[t, 3.6e-84], N[(x + N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -4 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{z}{a} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.9999999999999999e-19 or 3.60000000000000003e-84 < t Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Applied rewrites51.6%
if -3.9999999999999999e-19 < t < 3.60000000000000003e-84Initial program 69.0%
Applied rewrites84.9%
Taylor expanded in t around 0
Applied rewrites49.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z t) (- a t)) y)))
(if (<= t -2.15e-19)
t_1
(if (<= t 3.3e-84) (+ x (/ (* z (- y x)) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -2.15e-19) {
tmp = t_1;
} else if (t <= 3.3e-84) {
tmp = x + ((z * (y - x)) / a);
} 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) / (a - t)) * y
if (t <= (-2.15d-19)) then
tmp = t_1
else if (t <= 3.3d-84) then
tmp = x + ((z * (y - x)) / a)
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) / (a - t)) * y;
double tmp;
if (t <= -2.15e-19) {
tmp = t_1;
} else if (t <= 3.3e-84) {
tmp = x + ((z * (y - x)) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) / (a - t)) * y tmp = 0 if t <= -2.15e-19: tmp = t_1 elif t <= 3.3e-84: tmp = x + ((z * (y - x)) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y) tmp = 0.0 if (t <= -2.15e-19) tmp = t_1; elseif (t <= 3.3e-84) tmp = Float64(x + Float64(Float64(z * Float64(y - x)) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) / (a - t)) * y; tmp = 0.0; if (t <= -2.15e-19) tmp = t_1; elseif (t <= 3.3e-84) tmp = x + ((z * (y - x)) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -2.15e-19], t$95$1, If[LessEqual[t, 3.3e-84], N[(x + N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{z \cdot \left(y - x\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.15e-19 or 3.29999999999999984e-84 < t Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Applied rewrites51.6%
if -2.15e-19 < t < 3.29999999999999984e-84Initial program 69.0%
Taylor expanded in t around 0
Applied rewrites44.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- z t) (- a t)) y))) (if (<= t -2.15e-19) t_1 (if (<= t 3e-84) (+ x (* (/ z a) y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -2.15e-19) {
tmp = t_1;
} else if (t <= 3e-84) {
tmp = x + ((z / a) * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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)) * y
if (t <= (-2.15d-19)) then
tmp = t_1
else if (t <= 3d-84) then
tmp = x + ((z / a) * y)
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) / (a - t)) * y;
double tmp;
if (t <= -2.15e-19) {
tmp = t_1;
} else if (t <= 3e-84) {
tmp = x + ((z / a) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) / (a - t)) * y tmp = 0 if t <= -2.15e-19: tmp = t_1 elif t <= 3e-84: tmp = x + ((z / a) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y) tmp = 0.0 if (t <= -2.15e-19) tmp = t_1; elseif (t <= 3e-84) tmp = Float64(x + Float64(Float64(z / a) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) / (a - t)) * y; tmp = 0.0; if (t <= -2.15e-19) tmp = t_1; elseif (t <= 3e-84) tmp = x + ((z / a) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -2.15e-19], t$95$1, If[LessEqual[t, 3e-84], N[(x + N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{z}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.15e-19 or 3.0000000000000001e-84 < t Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Applied rewrites51.6%
if -2.15e-19 < t < 3.0000000000000001e-84Initial program 69.0%
Applied rewrites84.9%
Taylor expanded in t around 0
Applied rewrites49.4%
Taylor expanded in x around 0
Applied rewrites41.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (- (/ z (- a t)) -1.0)))) (if (<= t -9.2e-19) t_1 (if (<= t 6.2e+20) (+ x (* (/ z a) y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z / (a - t)) - -1.0);
double tmp;
if (t <= -9.2e-19) {
tmp = t_1;
} else if (t <= 6.2e+20) {
tmp = x + ((z / a) * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * ((z / (a - t)) - (-1.0d0))
if (t <= (-9.2d-19)) then
tmp = t_1
else if (t <= 6.2d+20) then
tmp = x + ((z / a) * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z / (a - t)) - -1.0);
double tmp;
if (t <= -9.2e-19) {
tmp = t_1;
} else if (t <= 6.2e+20) {
tmp = x + ((z / a) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z / (a - t)) - -1.0) tmp = 0 if t <= -9.2e-19: tmp = t_1 elif t <= 6.2e+20: tmp = x + ((z / a) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z / Float64(a - t)) - -1.0)) tmp = 0.0 if (t <= -9.2e-19) tmp = t_1; elseif (t <= 6.2e+20) tmp = Float64(x + Float64(Float64(z / a) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z / (a - t)) - -1.0); tmp = 0.0; if (t <= -9.2e-19) tmp = t_1; elseif (t <= 6.2e+20) tmp = x + ((z / a) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.2e-19], t$95$1, If[LessEqual[t, 6.2e+20], N[(x + N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\frac{z}{a - t} - -1\right)\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+20}:\\
\;\;\;\;x + \frac{z}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.19999999999999919e-19 or 6.2e20 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
if -9.19999999999999919e-19 < t < 6.2e20Initial program 69.0%
Applied rewrites84.9%
Taylor expanded in t around 0
Applied rewrites49.4%
Taylor expanded in x around 0
Applied rewrites41.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5) (* y 1.0) (if (<= t 3.7e+164) (+ x (* (/ z a) y)) (* y 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5) {
tmp = y * 1.0;
} else if (t <= 3.7e+164) {
tmp = x + ((z / a) * y);
} else {
tmp = y * 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.5d0)) then
tmp = y * 1.0d0
else if (t <= 3.7d+164) then
tmp = x + ((z / a) * y)
else
tmp = y * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5) {
tmp = y * 1.0;
} else if (t <= 3.7e+164) {
tmp = x + ((z / a) * y);
} else {
tmp = y * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.5: tmp = y * 1.0 elif t <= 3.7e+164: tmp = x + ((z / a) * y) else: tmp = y * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5) tmp = Float64(y * 1.0); elseif (t <= 3.7e+164) tmp = Float64(x + Float64(Float64(z / a) * y)); else tmp = Float64(y * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.5) tmp = y * 1.0; elseif (t <= 3.7e+164) tmp = x + ((z / a) * y); else tmp = y * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5], N[(y * 1.0), $MachinePrecision], If[LessEqual[t, 3.7e+164], N[(x + N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(y * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5:\\
\;\;\;\;y \cdot 1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+164}:\\
\;\;\;\;x + \frac{z}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot 1\\
\end{array}
\end{array}
if t < -2.5 or 3.7000000000000001e164 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
Taylor expanded in t around inf
Applied rewrites24.8%
if -2.5 < t < 3.7000000000000001e164Initial program 69.0%
Applied rewrites84.9%
Taylor expanded in t around 0
Applied rewrites49.4%
Taylor expanded in x around 0
Applied rewrites41.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -500000000.0) (* y 1.0) (if (<= t 3.7e+70) (* (/ (- z t) a) y) (* y 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -500000000.0) {
tmp = y * 1.0;
} else if (t <= 3.7e+70) {
tmp = ((z - t) / a) * y;
} else {
tmp = y * 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-500000000.0d0)) then
tmp = y * 1.0d0
else if (t <= 3.7d+70) then
tmp = ((z - t) / a) * y
else
tmp = y * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -500000000.0) {
tmp = y * 1.0;
} else if (t <= 3.7e+70) {
tmp = ((z - t) / a) * y;
} else {
tmp = y * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -500000000.0: tmp = y * 1.0 elif t <= 3.7e+70: tmp = ((z - t) / a) * y else: tmp = y * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -500000000.0) tmp = Float64(y * 1.0); elseif (t <= 3.7e+70) tmp = Float64(Float64(Float64(z - t) / a) * y); else tmp = Float64(y * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -500000000.0) tmp = y * 1.0; elseif (t <= 3.7e+70) tmp = ((z - t) / a) * y; else tmp = y * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -500000000.0], N[(y * 1.0), $MachinePrecision], If[LessEqual[t, 3.7e+70], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], N[(y * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -500000000:\\
\;\;\;\;y \cdot 1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+70}:\\
\;\;\;\;\frac{z - t}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot 1\\
\end{array}
\end{array}
if t < -5e8 or 3.69999999999999989e70 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
Taylor expanded in t around inf
Applied rewrites24.8%
if -5e8 < t < 3.69999999999999989e70Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Applied rewrites51.6%
Taylor expanded in t around 0
Applied rewrites23.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -500000000.0) (* y 1.0) (if (<= t 3.7e+70) (* (/ y a) (- z t)) (* y 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -500000000.0) {
tmp = y * 1.0;
} else if (t <= 3.7e+70) {
tmp = (y / a) * (z - t);
} else {
tmp = y * 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-500000000.0d0)) then
tmp = y * 1.0d0
else if (t <= 3.7d+70) then
tmp = (y / a) * (z - t)
else
tmp = y * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -500000000.0) {
tmp = y * 1.0;
} else if (t <= 3.7e+70) {
tmp = (y / a) * (z - t);
} else {
tmp = y * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -500000000.0: tmp = y * 1.0 elif t <= 3.7e+70: tmp = (y / a) * (z - t) else: tmp = y * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -500000000.0) tmp = Float64(y * 1.0); elseif (t <= 3.7e+70) tmp = Float64(Float64(y / a) * Float64(z - t)); else tmp = Float64(y * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -500000000.0) tmp = y * 1.0; elseif (t <= 3.7e+70) tmp = (y / a) * (z - t); else tmp = y * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -500000000.0], N[(y * 1.0), $MachinePrecision], If[LessEqual[t, 3.7e+70], N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision], N[(y * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -500000000:\\
\;\;\;\;y \cdot 1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+70}:\\
\;\;\;\;\frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 1\\
\end{array}
\end{array}
if t < -5e8 or 3.69999999999999989e70 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
Taylor expanded in t around inf
Applied rewrites24.8%
if -5e8 < t < 3.69999999999999989e70Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Taylor expanded in a around inf
Applied rewrites20.1%
Applied rewrites22.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -0.55) (* y 1.0) (if (<= t 3.6e-82) (* (/ z a) y) (* y 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -0.55) {
tmp = y * 1.0;
} else if (t <= 3.6e-82) {
tmp = (z / a) * y;
} else {
tmp = y * 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-0.55d0)) then
tmp = y * 1.0d0
else if (t <= 3.6d-82) then
tmp = (z / a) * y
else
tmp = y * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -0.55) {
tmp = y * 1.0;
} else if (t <= 3.6e-82) {
tmp = (z / a) * y;
} else {
tmp = y * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -0.55: tmp = y * 1.0 elif t <= 3.6e-82: tmp = (z / a) * y else: tmp = y * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -0.55) tmp = Float64(y * 1.0); elseif (t <= 3.6e-82) tmp = Float64(Float64(z / a) * y); else tmp = Float64(y * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -0.55) tmp = y * 1.0; elseif (t <= 3.6e-82) tmp = (z / a) * y; else tmp = y * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -0.55], N[(y * 1.0), $MachinePrecision], If[LessEqual[t, 3.6e-82], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision], N[(y * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.55:\\
\;\;\;\;y \cdot 1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot 1\\
\end{array}
\end{array}
if t < -0.55000000000000004 or 3.59999999999999998e-82 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
Taylor expanded in t around inf
Applied rewrites24.8%
if -0.55000000000000004 < t < 3.59999999999999998e-82Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Taylor expanded in t around 0
Applied rewrites16.9%
Applied rewrites19.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.2e-92) (* y 1.0) (if (<= t 3.6e-82) (* (/ y a) z) (* y 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.2e-92) {
tmp = y * 1.0;
} else if (t <= 3.6e-82) {
tmp = (y / a) * z;
} else {
tmp = y * 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-5.2d-92)) then
tmp = y * 1.0d0
else if (t <= 3.6d-82) then
tmp = (y / a) * z
else
tmp = y * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.2e-92) {
tmp = y * 1.0;
} else if (t <= 3.6e-82) {
tmp = (y / a) * z;
} else {
tmp = y * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.2e-92: tmp = y * 1.0 elif t <= 3.6e-82: tmp = (y / a) * z else: tmp = y * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.2e-92) tmp = Float64(y * 1.0); elseif (t <= 3.6e-82) tmp = Float64(Float64(y / a) * z); else tmp = Float64(y * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.2e-92) tmp = y * 1.0; elseif (t <= 3.6e-82) tmp = (y / a) * z; else tmp = y * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.2e-92], N[(y * 1.0), $MachinePrecision], If[LessEqual[t, 3.6e-82], N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision], N[(y * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-92}:\\
\;\;\;\;y \cdot 1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;y \cdot 1\\
\end{array}
\end{array}
if t < -5.2e-92 or 3.59999999999999998e-82 < t Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
Taylor expanded in t around inf
Applied rewrites24.8%
if -5.2e-92 < t < 3.59999999999999998e-82Initial program 69.0%
Taylor expanded in x around 0
Applied rewrites39.9%
Taylor expanded in t around 0
Applied rewrites16.9%
Applied rewrites18.5%
(FPCore (x y z t a) :precision binary64 (* y 1.0))
double code(double x, double y, double z, double t, double a) {
return y * 1.0;
}
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 * 1.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return y * 1.0;
}
def code(x, y, z, t, a): return y * 1.0
function code(x, y, z, t, a) return Float64(y * 1.0) end
function tmp = code(x, y, z, t, a) tmp = y * 1.0; end
code[x_, y_, z_, t_, a_] := N[(y * 1.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 1
\end{array}
Initial program 69.0%
Taylor expanded in y around inf
Applied rewrites51.6%
Taylor expanded in t around inf
Applied rewrites42.0%
Taylor expanded in t around inf
Applied rewrites24.8%
herbie shell --seed 2025159
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y x) (- z t)) (- a t))))