
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
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 - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
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 - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- z y) (- a z)) (- x t) x))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -2e+36)
t_1
(if (<= t_2 5e-126)
(/ (fma -1.0 (* t (- y z)) (* x (- y a))) (- z a))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((z - y) / (a - z)), (x - t), x);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -2e+36) {
tmp = t_1;
} else if (t_2 <= 5e-126) {
tmp = fma(-1.0, (t * (y - z)), (x * (y - a))) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(z - y) / Float64(a - z)), Float64(x - t), x) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -2e+36) tmp = t_1; elseif (t_2 <= 5e-126) tmp = Float64(fma(-1.0, Float64(t * Float64(y - z)), Float64(x * Float64(y - a))) / Float64(z - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+36], t$95$1, If[LessEqual[t$95$2, 5e-126], N[(N[(-1.0 * N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - y}{a - z}, x - t, x\right)\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-126}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, t \cdot \left(y - z\right), x \cdot \left(y - a\right)\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000008e36 or 5.00000000000000006e-126 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/r/N/A
lift--.f64N/A
sub-divN/A
lift-/.f64N/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites83.9%
if -2.00000000000000008e36 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.00000000000000006e-126Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6474.0
Applied rewrites74.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- z y) (- a z)) (- x t) x))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -1e-231) t_1 (if (<= t_2 0.0) (/ (* x (- y a)) (- z a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((z - y) / (a - z)), (x - t), x);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -1e-231) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (x * (y - a)) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(z - y) / Float64(a - z)), Float64(x - t), x) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -1e-231) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-231], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - y}{a - z}, x - t, x\right)\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999999e-232 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/r/N/A
lift--.f64N/A
sub-divN/A
lift-/.f64N/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites83.9%
if -9.9999999999999999e-232 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x t) (- z a)) (- y z) x))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -2e-137)
t_1
(if (<= t_2 1e-182)
(/ (* x (- y a)) (- z a))
(if (<= t_2 5e+306) t_1 (+ x (/ (* y (- t x)) (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - t) / (z - a)), (y - z), x);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -2e-137) {
tmp = t_1;
} else if (t_2 <= 1e-182) {
tmp = (x * (y - a)) / (z - a);
} else if (t_2 <= 5e+306) {
tmp = t_1;
} else {
tmp = x + ((y * (t - x)) / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -2e-137) tmp = t_1; elseif (t_2 <= 1e-182) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); elseif (t_2 <= 5e+306) tmp = t_1; else tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-137], t$95$1, If[LessEqual[t$95$2, 1e-182], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+306], t$95$1, N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-182}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.99999999999999996e-137 or 1e-182 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6479.5
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
if -1.99999999999999996e-137 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-182Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
if 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.5%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.4
Applied rewrites54.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7e-91)
(+ x (* (- y z) (/ t (- a z))))
(if (<= t 9e-51)
(/ (* x (- y a)) (- z a))
(+ x (/ (- z y) (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e-91) {
tmp = x + ((y - z) * (t / (a - z)));
} else if (t <= 9e-51) {
tmp = (x * (y - a)) / (z - a);
} else {
tmp = x + ((z - y) / ((z - a) / t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-7d-91)) then
tmp = x + ((y - z) * (t / (a - z)))
else if (t <= 9d-51) then
tmp = (x * (y - a)) / (z - a)
else
tmp = x + ((z - y) / ((z - a) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e-91) {
tmp = x + ((y - z) * (t / (a - z)));
} else if (t <= 9e-51) {
tmp = (x * (y - a)) / (z - a);
} else {
tmp = x + ((z - y) / ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e-91: tmp = x + ((y - z) * (t / (a - z))) elif t <= 9e-51: tmp = (x * (y - a)) / (z - a) else: tmp = x + ((z - y) / ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e-91) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); elseif (t <= 9e-51) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e-91) tmp = x + ((y - z) * (t / (a - z))); elseif (t <= 9e-51) tmp = (x * (y - a)) / (z - a); else tmp = x + ((z - y) / ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e-91], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e-51], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-91}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{z - a}{t}}\\
\end{array}
\end{array}
if t < -6.9999999999999997e-91Initial program 79.5%
Taylor expanded in x around 0
Applied rewrites63.7%
if -6.9999999999999997e-91 < t < 8.99999999999999948e-51Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
if 8.99999999999999948e-51 < t Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6436.9
Applied rewrites36.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6463.6
Applied rewrites63.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* (- y z) (/ t (- a z)))))) (if (<= t -7e-91) t_1 (if (<= t 9e-51) (/ (* x (- y a)) (- z a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / (a - z)));
double tmp;
if (t <= -7e-91) {
tmp = t_1;
} else if (t <= 9e-51) {
tmp = (x * (y - a)) / (z - 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 = x + ((y - z) * (t / (a - z)))
if (t <= (-7d-91)) then
tmp = t_1
else if (t <= 9d-51) then
tmp = (x * (y - a)) / (z - 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 = x + ((y - z) * (t / (a - z)));
double tmp;
if (t <= -7e-91) {
tmp = t_1;
} else if (t <= 9e-51) {
tmp = (x * (y - a)) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / (a - z))) tmp = 0 if t <= -7e-91: tmp = t_1 elif t <= 9e-51: tmp = (x * (y - a)) / (z - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) tmp = 0.0 if (t <= -7e-91) tmp = t_1; elseif (t <= 9e-51) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * (t / (a - z))); tmp = 0.0; if (t <= -7e-91) tmp = t_1; elseif (t <= 9e-51) tmp = (x * (y - a)) / (z - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e-91], t$95$1, If[LessEqual[t, 9e-51], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;t \leq -7 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-51}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.9999999999999997e-91 or 8.99999999999999948e-51 < t Initial program 79.5%
Taylor expanded in x around 0
Applied rewrites63.7%
if -6.9999999999999997e-91 < t < 8.99999999999999948e-51Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.2e-9)
(fma (/ (- z y) a) (- x t) x)
(if (<= a -1.92e-174)
(/ (* x (- y a)) (- z a))
(if (<= a 1.7e-27)
(* (/ (- y z) (- a z)) t)
(fma (/ (- t x) a) (- y z) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e-9) {
tmp = fma(((z - y) / a), (x - t), x);
} else if (a <= -1.92e-174) {
tmp = (x * (y - a)) / (z - a);
} else if (a <= 1.7e-27) {
tmp = ((y - z) / (a - z)) * t;
} else {
tmp = fma(((t - x) / a), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e-9) tmp = fma(Float64(Float64(z - y) / a), Float64(x - t), x); elseif (a <= -1.92e-174) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); elseif (a <= 1.7e-27) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); else tmp = fma(Float64(Float64(t - x) / a), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e-9], N[(N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] * N[(x - t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -1.92e-174], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e-27], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - y}{a}, x - t, x\right)\\
\mathbf{elif}\;a \leq -1.92 \cdot 10^{-174}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-27}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\end{array}
\end{array}
if a < -4.20000000000000039e-9Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/r/N/A
lift--.f64N/A
sub-divN/A
lift-/.f64N/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites83.9%
Taylor expanded in z around 0
Applied rewrites52.6%
if -4.20000000000000039e-9 < a < -1.92e-174Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
if -1.92e-174 < a < 1.69999999999999985e-27Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.6
Applied rewrites51.6%
if 1.69999999999999985e-27 < a Initial program 79.5%
Taylor expanded in z around 0
Applied rewrites51.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) (- y z) x)))
(if (<= a -4.2e-9)
t_1
(if (<= a -1.92e-174)
(/ (* x (- y a)) (- z a))
(if (<= a 1.7e-27) (* (/ (- y z) (- a z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), (y - z), x);
double tmp;
if (a <= -4.2e-9) {
tmp = t_1;
} else if (a <= -1.92e-174) {
tmp = (x * (y - a)) / (z - a);
} else if (a <= 1.7e-27) {
tmp = ((y - z) / (a - z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), Float64(y - z), x) tmp = 0.0 if (a <= -4.2e-9) tmp = t_1; elseif (a <= -1.92e-174) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); elseif (a <= 1.7e-27) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -4.2e-9], t$95$1, If[LessEqual[a, -1.92e-174], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e-27], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.92 \cdot 10^{-174}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-27}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.20000000000000039e-9 or 1.69999999999999985e-27 < a Initial program 79.5%
Taylor expanded in z around 0
Applied rewrites51.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6451.1
Applied rewrites51.1%
if -4.20000000000000039e-9 < a < -1.92e-174Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
if -1.92e-174 < a < 1.69999999999999985e-27Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.42e-8)
(+ x (* (- t x) (/ y a)))
(if (<= a -1.92e-174)
(/ (* x (- y a)) (- z a))
(if (<= a 1.6e-30)
(* (/ (- y z) (- a z)) t)
(if (<= a 6.1e+35)
(* y (/ (- t x) (- a z)))
(+ x (* (- y z) (/ t a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.42e-8) {
tmp = x + ((t - x) * (y / a));
} else if (a <= -1.92e-174) {
tmp = (x * (y - a)) / (z - a);
} else if (a <= 1.6e-30) {
tmp = ((y - z) / (a - z)) * t;
} else if (a <= 6.1e+35) {
tmp = y * ((t - x) / (a - z));
} else {
tmp = x + ((y - z) * (t / a));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.42d-8)) then
tmp = x + ((t - x) * (y / a))
else if (a <= (-1.92d-174)) then
tmp = (x * (y - a)) / (z - a)
else if (a <= 1.6d-30) then
tmp = ((y - z) / (a - z)) * t
else if (a <= 6.1d+35) then
tmp = y * ((t - x) / (a - z))
else
tmp = x + ((y - z) * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.42e-8) {
tmp = x + ((t - x) * (y / a));
} else if (a <= -1.92e-174) {
tmp = (x * (y - a)) / (z - a);
} else if (a <= 1.6e-30) {
tmp = ((y - z) / (a - z)) * t;
} else if (a <= 6.1e+35) {
tmp = y * ((t - x) / (a - z));
} else {
tmp = x + ((y - z) * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.42e-8: tmp = x + ((t - x) * (y / a)) elif a <= -1.92e-174: tmp = (x * (y - a)) / (z - a) elif a <= 1.6e-30: tmp = ((y - z) / (a - z)) * t elif a <= 6.1e+35: tmp = y * ((t - x) / (a - z)) else: tmp = x + ((y - z) * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.42e-8) tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); elseif (a <= -1.92e-174) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); elseif (a <= 1.6e-30) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); elseif (a <= 6.1e+35) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); else tmp = Float64(x + Float64(Float64(y - z) * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.42e-8) tmp = x + ((t - x) * (y / a)); elseif (a <= -1.92e-174) tmp = (x * (y - a)) / (z - a); elseif (a <= 1.6e-30) tmp = ((y - z) / (a - z)) * t; elseif (a <= 6.1e+35) tmp = y * ((t - x) / (a - z)); else tmp = x + ((y - z) * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.42e-8], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.92e-174], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e-30], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 6.1e+35], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.42 \cdot 10^{-8}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq -1.92 \cdot 10^{-174}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-30}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{elif}\;a \leq 6.1 \cdot 10^{+35}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -1.41999999999999998e-8Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.1
Applied rewrites44.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.3
Applied rewrites48.3%
if -1.41999999999999998e-8 < a < -1.92e-174Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
if -1.92e-174 < a < 1.6e-30Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.6
Applied rewrites51.6%
if 1.6e-30 < a < 6.09999999999999977e35Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
distribute-rgt-neg-inN/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6441.3
Applied rewrites41.3%
if 6.09999999999999977e35 < a Initial program 79.5%
Taylor expanded in z around 0
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites43.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- t x) (/ y a)))))
(if (<= a -1.42e-8)
t_1
(if (<= a -1.92e-174)
(/ (* x (- y a)) (- z a))
(if (<= a 1.7e-27) (* (/ (- y z) (- a z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t - x) * (y / a));
double tmp;
if (a <= -1.42e-8) {
tmp = t_1;
} else if (a <= -1.92e-174) {
tmp = (x * (y - a)) / (z - a);
} else if (a <= 1.7e-27) {
tmp = ((y - z) / (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) :: tmp
t_1 = x + ((t - x) * (y / a))
if (a <= (-1.42d-8)) then
tmp = t_1
else if (a <= (-1.92d-174)) then
tmp = (x * (y - a)) / (z - a)
else if (a <= 1.7d-27) then
tmp = ((y - z) / (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 + ((t - x) * (y / a));
double tmp;
if (a <= -1.42e-8) {
tmp = t_1;
} else if (a <= -1.92e-174) {
tmp = (x * (y - a)) / (z - a);
} else if (a <= 1.7e-27) {
tmp = ((y - z) / (a - z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t - x) * (y / a)) tmp = 0 if a <= -1.42e-8: tmp = t_1 elif a <= -1.92e-174: tmp = (x * (y - a)) / (z - a) elif a <= 1.7e-27: tmp = ((y - z) / (a - z)) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t - x) * Float64(y / a))) tmp = 0.0 if (a <= -1.42e-8) tmp = t_1; elseif (a <= -1.92e-174) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); elseif (a <= 1.7e-27) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t - x) * (y / a)); tmp = 0.0; if (a <= -1.42e-8) tmp = t_1; elseif (a <= -1.92e-174) tmp = (x * (y - a)) / (z - a); elseif (a <= 1.7e-27) tmp = ((y - z) / (a - z)) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.42e-8], t$95$1, If[LessEqual[a, -1.92e-174], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e-27], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{if}\;a \leq -1.42 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.92 \cdot 10^{-174}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-27}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.41999999999999998e-8 or 1.69999999999999985e-27 < a Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.1
Applied rewrites44.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.3
Applied rewrites48.3%
if -1.41999999999999998e-8 < a < -1.92e-174Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
if -1.92e-174 < a < 1.69999999999999985e-27Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (/ y (- z a)) (- t x)))))
(if (<= y -5.4e+116)
t_1
(if (<= y 8.5e+60) (fma (/ z (- a z)) (- x t) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -((y / (z - a)) * (t - x));
double tmp;
if (y <= -5.4e+116) {
tmp = t_1;
} else if (y <= 8.5e+60) {
tmp = fma((z / (a - z)), (x - t), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-Float64(Float64(y / Float64(z - a)) * Float64(t - x))) tmp = 0.0 if (y <= -5.4e+116) tmp = t_1; elseif (y <= 8.5e+60) tmp = fma(Float64(z / Float64(a - z)), Float64(x - t), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[y, -5.4e+116], t$95$1, If[LessEqual[y, 8.5e+60], N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{y}{z - a} \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a - z}, x - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.3999999999999999e116 or 8.50000000000000064e60 < y Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
div-flipN/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
div-flipN/A
lower-neg.f64N/A
lift--.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6442.8
Applied rewrites42.8%
if -5.3999999999999999e116 < y < 8.50000000000000064e60Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/r/N/A
lift--.f64N/A
sub-divN/A
lift-/.f64N/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites83.9%
Taylor expanded in y around 0
Applied rewrites47.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- y z) (- a z)) t))) (if (<= t -7.9e-75) t_1 (if (<= t 1.4e-39) (/ (* x (- y a)) (- z a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) / (a - z)) * t;
double tmp;
if (t <= -7.9e-75) {
tmp = t_1;
} else if (t <= 1.4e-39) {
tmp = (x * (y - a)) / (z - 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 = ((y - z) / (a - z)) * t
if (t <= (-7.9d-75)) then
tmp = t_1
else if (t <= 1.4d-39) then
tmp = (x * (y - a)) / (z - 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 = ((y - z) / (a - z)) * t;
double tmp;
if (t <= -7.9e-75) {
tmp = t_1;
} else if (t <= 1.4e-39) {
tmp = (x * (y - a)) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) / (a - z)) * t tmp = 0 if t <= -7.9e-75: tmp = t_1 elif t <= 1.4e-39: tmp = (x * (y - a)) / (z - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) / Float64(a - z)) * t) tmp = 0.0 if (t <= -7.9e-75) tmp = t_1; elseif (t <= 1.4e-39) tmp = Float64(Float64(x * Float64(y - a)) / Float64(z - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) / (a - z)) * t; tmp = 0.0; if (t <= -7.9e-75) tmp = t_1; elseif (t <= 1.4e-39) tmp = (x * (y - a)) / (z - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -7.9e-75], t$95$1, If[LessEqual[t, 1.4e-39], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t \leq -7.9 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-39}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.9e-75 or 1.4000000000000001e-39 < t Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.6
Applied rewrites51.6%
if -7.9e-75 < t < 1.4000000000000001e-39Initial program 79.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
add-to-fractionN/A
lower-/.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6463.2
Applied rewrites63.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t x) (- a z)))) (t_2 (+ x (/ (* t y) a))))
(if (<= a -0.0021)
t_2
(if (<= a -5e-173)
t_1
(if (<= a 1.6e-30)
(* (/ (- y z) (- a z)) t)
(if (<= a 6.2e+35) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / (a - z));
double t_2 = x + ((t * y) / a);
double tmp;
if (a <= -0.0021) {
tmp = t_2;
} else if (a <= -5e-173) {
tmp = t_1;
} else if (a <= 1.6e-30) {
tmp = ((y - z) / (a - z)) * t;
} else if (a <= 6.2e+35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * ((t - x) / (a - z))
t_2 = x + ((t * y) / a)
if (a <= (-0.0021d0)) then
tmp = t_2
else if (a <= (-5d-173)) then
tmp = t_1
else if (a <= 1.6d-30) then
tmp = ((y - z) / (a - z)) * t
else if (a <= 6.2d+35) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / (a - z));
double t_2 = x + ((t * y) / a);
double tmp;
if (a <= -0.0021) {
tmp = t_2;
} else if (a <= -5e-173) {
tmp = t_1;
} else if (a <= 1.6e-30) {
tmp = ((y - z) / (a - z)) * t;
} else if (a <= 6.2e+35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((t - x) / (a - z)) t_2 = x + ((t * y) / a) tmp = 0 if a <= -0.0021: tmp = t_2 elif a <= -5e-173: tmp = t_1 elif a <= 1.6e-30: tmp = ((y - z) / (a - z)) * t elif a <= 6.2e+35: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(t - x) / Float64(a - z))) t_2 = Float64(x + Float64(Float64(t * y) / a)) tmp = 0.0 if (a <= -0.0021) tmp = t_2; elseif (a <= -5e-173) tmp = t_1; elseif (a <= 1.6e-30) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); elseif (a <= 6.2e+35) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((t - x) / (a - z)); t_2 = x + ((t * y) / a); tmp = 0.0; if (a <= -0.0021) tmp = t_2; elseif (a <= -5e-173) tmp = t_1; elseif (a <= 1.6e-30) tmp = ((y - z) / (a - z)) * t; elseif (a <= 6.2e+35) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0021], t$95$2, If[LessEqual[a, -5e-173], t$95$1, If[LessEqual[a, 1.6e-30], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 6.2e+35], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t - x}{a - z}\\
t_2 := x + \frac{t \cdot y}{a}\\
\mathbf{if}\;a \leq -0.0021:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -5 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-30}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -0.00209999999999999987 or 6.19999999999999973e35 < a Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.1
Applied rewrites44.1%
Taylor expanded in x around 0
lower-*.f6437.8
Applied rewrites37.8%
if -0.00209999999999999987 < a < -5.0000000000000002e-173 or 1.6e-30 < a < 6.19999999999999973e35Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
distribute-rgt-neg-inN/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6441.3
Applied rewrites41.3%
if -5.0000000000000002e-173 < a < 1.6e-30Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t x) (- a z)))) (t_2 (+ x (/ (* t y) a))))
(if (<= a -0.0021)
t_2
(if (<= a -5e-173)
t_1
(if (<= a 1.55e-30)
(* t (- (/ y (- a z)) -1.0))
(if (<= a 6.2e+35) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / (a - z));
double t_2 = x + ((t * y) / a);
double tmp;
if (a <= -0.0021) {
tmp = t_2;
} else if (a <= -5e-173) {
tmp = t_1;
} else if (a <= 1.55e-30) {
tmp = t * ((y / (a - z)) - -1.0);
} else if (a <= 6.2e+35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * ((t - x) / (a - z))
t_2 = x + ((t * y) / a)
if (a <= (-0.0021d0)) then
tmp = t_2
else if (a <= (-5d-173)) then
tmp = t_1
else if (a <= 1.55d-30) then
tmp = t * ((y / (a - z)) - (-1.0d0))
else if (a <= 6.2d+35) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / (a - z));
double t_2 = x + ((t * y) / a);
double tmp;
if (a <= -0.0021) {
tmp = t_2;
} else if (a <= -5e-173) {
tmp = t_1;
} else if (a <= 1.55e-30) {
tmp = t * ((y / (a - z)) - -1.0);
} else if (a <= 6.2e+35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((t - x) / (a - z)) t_2 = x + ((t * y) / a) tmp = 0 if a <= -0.0021: tmp = t_2 elif a <= -5e-173: tmp = t_1 elif a <= 1.55e-30: tmp = t * ((y / (a - z)) - -1.0) elif a <= 6.2e+35: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(t - x) / Float64(a - z))) t_2 = Float64(x + Float64(Float64(t * y) / a)) tmp = 0.0 if (a <= -0.0021) tmp = t_2; elseif (a <= -5e-173) tmp = t_1; elseif (a <= 1.55e-30) tmp = Float64(t * Float64(Float64(y / Float64(a - z)) - -1.0)); elseif (a <= 6.2e+35) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((t - x) / (a - z)); t_2 = x + ((t * y) / a); tmp = 0.0; if (a <= -0.0021) tmp = t_2; elseif (a <= -5e-173) tmp = t_1; elseif (a <= 1.55e-30) tmp = t * ((y / (a - z)) - -1.0); elseif (a <= 6.2e+35) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0021], t$95$2, If[LessEqual[a, -5e-173], t$95$1, If[LessEqual[a, 1.55e-30], N[(t * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.2e+35], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t - x}{a - z}\\
t_2 := x + \frac{t \cdot y}{a}\\
\mathbf{if}\;a \leq -0.0021:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -5 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-30}:\\
\;\;\;\;t \cdot \left(\frac{y}{a - z} - -1\right)\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -0.00209999999999999987 or 6.19999999999999973e35 < a Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.1
Applied rewrites44.1%
Taylor expanded in x around 0
lower-*.f6437.8
Applied rewrites37.8%
if -0.00209999999999999987 < a < -5.0000000000000002e-173 or 1.54999999999999995e-30 < a < 6.19999999999999973e35Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
distribute-rgt-neg-inN/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6441.3
Applied rewrites41.3%
if -5.0000000000000002e-173 < a < 1.54999999999999995e-30Initial program 79.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around inf
Applied rewrites42.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* t y) a))))
(if (<= a -2.5e-38)
t_1
(if (<= a -1.25e-172)
(/ (* x y) (- z a))
(if (<= a 1.15e-29) (* t (- (/ y (- a z)) -1.0)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t * y) / a);
double tmp;
if (a <= -2.5e-38) {
tmp = t_1;
} else if (a <= -1.25e-172) {
tmp = (x * y) / (z - a);
} else if (a <= 1.15e-29) {
tmp = t * ((y / (a - z)) - -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 = x + ((t * y) / a)
if (a <= (-2.5d-38)) then
tmp = t_1
else if (a <= (-1.25d-172)) then
tmp = (x * y) / (z - a)
else if (a <= 1.15d-29) then
tmp = t * ((y / (a - z)) - (-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 = x + ((t * y) / a);
double tmp;
if (a <= -2.5e-38) {
tmp = t_1;
} else if (a <= -1.25e-172) {
tmp = (x * y) / (z - a);
} else if (a <= 1.15e-29) {
tmp = t * ((y / (a - z)) - -1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t * y) / a) tmp = 0 if a <= -2.5e-38: tmp = t_1 elif a <= -1.25e-172: tmp = (x * y) / (z - a) elif a <= 1.15e-29: tmp = t * ((y / (a - z)) - -1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t * y) / a)) tmp = 0.0 if (a <= -2.5e-38) tmp = t_1; elseif (a <= -1.25e-172) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (a <= 1.15e-29) tmp = Float64(t * Float64(Float64(y / Float64(a - z)) - -1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t * y) / a); tmp = 0.0; if (a <= -2.5e-38) tmp = t_1; elseif (a <= -1.25e-172) tmp = (x * y) / (z - a); elseif (a <= 1.15e-29) tmp = t * ((y / (a - z)) - -1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.5e-38], t$95$1, If[LessEqual[a, -1.25e-172], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e-29], N[(t * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{t \cdot y}{a}\\
\mathbf{if}\;a \leq -2.5 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-172}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-29}:\\
\;\;\;\;t \cdot \left(\frac{y}{a - z} - -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.50000000000000017e-38 or 1.14999999999999996e-29 < a Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.1
Applied rewrites44.1%
Taylor expanded in x around 0
lower-*.f6437.8
Applied rewrites37.8%
if -2.50000000000000017e-38 < a < -1.25e-172Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if -1.25e-172 < a < 1.14999999999999996e-29Initial program 79.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around inf
Applied rewrites42.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* t y) a))))
(if (<= a -2.5e-38)
t_1
(if (<= a 9e-297)
(/ (* x y) (- z a))
(if (<= a 2.35e-36) (/ (* t (- z y)) z) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t * y) / a);
double tmp;
if (a <= -2.5e-38) {
tmp = t_1;
} else if (a <= 9e-297) {
tmp = (x * y) / (z - a);
} else if (a <= 2.35e-36) {
tmp = (t * (z - y)) / z;
} 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 + ((t * y) / a)
if (a <= (-2.5d-38)) then
tmp = t_1
else if (a <= 9d-297) then
tmp = (x * y) / (z - a)
else if (a <= 2.35d-36) then
tmp = (t * (z - y)) / z
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 + ((t * y) / a);
double tmp;
if (a <= -2.5e-38) {
tmp = t_1;
} else if (a <= 9e-297) {
tmp = (x * y) / (z - a);
} else if (a <= 2.35e-36) {
tmp = (t * (z - y)) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((t * y) / a) tmp = 0 if a <= -2.5e-38: tmp = t_1 elif a <= 9e-297: tmp = (x * y) / (z - a) elif a <= 2.35e-36: tmp = (t * (z - y)) / z else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t * y) / a)) tmp = 0.0 if (a <= -2.5e-38) tmp = t_1; elseif (a <= 9e-297) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (a <= 2.35e-36) tmp = Float64(Float64(t * Float64(z - y)) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((t * y) / a); tmp = 0.0; if (a <= -2.5e-38) tmp = t_1; elseif (a <= 9e-297) tmp = (x * y) / (z - a); elseif (a <= 2.35e-36) tmp = (t * (z - y)) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.5e-38], t$95$1, If[LessEqual[a, 9e-297], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.35e-36], N[(N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{t \cdot y}{a}\\
\mathbf{if}\;a \leq -2.5 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-297}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-36}:\\
\;\;\;\;\frac{t \cdot \left(z - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.50000000000000017e-38 or 2.3500000000000001e-36 < a Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.1
Applied rewrites44.1%
Taylor expanded in x around 0
lower-*.f6437.8
Applied rewrites37.8%
if -2.50000000000000017e-38 < a < 8.99999999999999951e-297Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if 8.99999999999999951e-297 < a < 2.3500000000000001e-36Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.7
Applied rewrites27.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (- z a))) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -9.37e+236)
t_1
(if (<= t_2 -1e-7)
(+ x t)
(if (<= t_2 -1e-191)
(/ (* t (- y z)) a)
(if (<= t_2 1e-182)
(/ (* t (- z y)) z)
(if (<= t_2 5e+306) (+ x t) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (z - a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -9.37e+236) {
tmp = t_1;
} else if (t_2 <= -1e-7) {
tmp = x + t;
} else if (t_2 <= -1e-191) {
tmp = (t * (y - z)) / a;
} else if (t_2 <= 1e-182) {
tmp = (t * (z - y)) / z;
} else if (t_2 <= 5e+306) {
tmp = 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 * y) / (z - a)
t_2 = x + ((y - z) * ((t - x) / (a - z)))
if (t_2 <= (-9.37d+236)) then
tmp = t_1
else if (t_2 <= (-1d-7)) then
tmp = x + t
else if (t_2 <= (-1d-191)) then
tmp = (t * (y - z)) / a
else if (t_2 <= 1d-182) then
tmp = (t * (z - y)) / z
else if (t_2 <= 5d+306) then
tmp = 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 * y) / (z - a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -9.37e+236) {
tmp = t_1;
} else if (t_2 <= -1e-7) {
tmp = x + t;
} else if (t_2 <= -1e-191) {
tmp = (t * (y - z)) / a;
} else if (t_2 <= 1e-182) {
tmp = (t * (z - y)) / z;
} else if (t_2 <= 5e+306) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / (z - a) t_2 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_2 <= -9.37e+236: tmp = t_1 elif t_2 <= -1e-7: tmp = x + t elif t_2 <= -1e-191: tmp = (t * (y - z)) / a elif t_2 <= 1e-182: tmp = (t * (z - y)) / z elif t_2 <= 5e+306: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(z - a)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -9.37e+236) tmp = t_1; elseif (t_2 <= -1e-7) tmp = Float64(x + t); elseif (t_2 <= -1e-191) tmp = Float64(Float64(t * Float64(y - z)) / a); elseif (t_2 <= 1e-182) tmp = Float64(Float64(t * Float64(z - y)) / z); elseif (t_2 <= 5e+306) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) / (z - a); t_2 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_2 <= -9.37e+236) tmp = t_1; elseif (t_2 <= -1e-7) tmp = x + t; elseif (t_2 <= -1e-191) tmp = (t * (y - z)) / a; elseif (t_2 <= 1e-182) tmp = (t * (z - y)) / z; elseif (t_2 <= 5e+306) tmp = x + 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[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -9.37e+236], t$95$1, If[LessEqual[t$95$2, -1e-7], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -1e-191], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 1e-182], N[(N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, 5e+306], N[(x + t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{z - a}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -9.37 \cdot 10^{+236}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-7}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-191}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a}\\
\mathbf{elif}\;t\_2 \leq 10^{-182}:\\
\;\;\;\;\frac{t \cdot \left(z - y\right)}{z}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.36999999999999961e236 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if -9.36999999999999961e236 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999995e-8 or 1e-182 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306Initial program 79.5%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if -9.9999999999999995e-8 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-191Initial program 79.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in a around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6419.6
Applied rewrites19.6%
if -1e-191 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-182Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
Taylor expanded in a around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6427.7
Applied rewrites27.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -8.8e+119) (/ (* x y) (- z a)) (if (<= y 1.42e+76) (+ x t) (/ (* t y) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -8.8e+119) {
tmp = (x * y) / (z - a);
} else if (y <= 1.42e+76) {
tmp = x + t;
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-8.8d+119)) then
tmp = (x * y) / (z - a)
else if (y <= 1.42d+76) then
tmp = x + t
else
tmp = (t * y) / (a - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -8.8e+119) {
tmp = (x * y) / (z - a);
} else if (y <= 1.42e+76) {
tmp = x + t;
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -8.8e+119: tmp = (x * y) / (z - a) elif y <= 1.42e+76: tmp = x + t else: tmp = (t * y) / (a - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -8.8e+119) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (y <= 1.42e+76) tmp = Float64(x + t); else tmp = Float64(Float64(t * y) / Float64(a - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -8.8e+119) tmp = (x * y) / (z - a); elseif (y <= 1.42e+76) tmp = x + t; else tmp = (t * y) / (a - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -8.8e+119], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+76], N[(x + t), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{+119}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+76}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\end{array}
\end{array}
if y < -8.8000000000000005e119Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if -8.8000000000000005e119 < y < 1.41999999999999996e76Initial program 79.5%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 1.41999999999999996e76 < y Initial program 79.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.8
Applied rewrites20.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* t y) (- a z)))) (if (<= y -1.25e+208) t_1 (if (<= y 1.42e+76) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * y) / (a - z);
double tmp;
if (y <= -1.25e+208) {
tmp = t_1;
} else if (y <= 1.42e+76) {
tmp = 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) :: tmp
t_1 = (t * y) / (a - z)
if (y <= (-1.25d+208)) then
tmp = t_1
else if (y <= 1.42d+76) then
tmp = 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 = (t * y) / (a - z);
double tmp;
if (y <= -1.25e+208) {
tmp = t_1;
} else if (y <= 1.42e+76) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * y) / (a - z) tmp = 0 if y <= -1.25e+208: tmp = t_1 elif y <= 1.42e+76: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * y) / Float64(a - z)) tmp = 0.0 if (y <= -1.25e+208) tmp = t_1; elseif (y <= 1.42e+76) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * y) / (a - z); tmp = 0.0; if (y <= -1.25e+208) tmp = t_1; elseif (y <= 1.42e+76) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+208], t$95$1, If[LessEqual[y, 1.42e+76], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot y}{a - z}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+208}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+76}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.2500000000000001e208 or 1.41999999999999996e76 < y Initial program 79.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.8
Applied rewrites20.8%
if -1.2500000000000001e208 < y < 1.41999999999999996e76Initial program 79.5%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
(FPCore (x y z t a) :precision binary64 (if (<= y 3.1e+127) (+ x t) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.1e+127) {
tmp = x + t;
} else {
tmp = t * (y / a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 3.1d+127) then
tmp = x + t
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.1e+127) {
tmp = x + t;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 3.1e+127: tmp = x + t else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 3.1e+127) tmp = Float64(x + t); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 3.1e+127) tmp = x + t; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3.1e+127], N[(x + t), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+127}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < 3.1000000000000002e127Initial program 79.5%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 3.1000000000000002e127 < y Initial program 79.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-/.f6418.7
Applied rewrites18.7%
(FPCore (x y z t a) :precision binary64 (if (<= y 4.6e+128) (+ x t) (/ (* t y) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.6e+128) {
tmp = x + t;
} else {
tmp = (t * y) / a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 4.6d+128) then
tmp = x + t
else
tmp = (t * y) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.6e+128) {
tmp = x + t;
} else {
tmp = (t * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 4.6e+128: tmp = x + t else: tmp = (t * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 4.6e+128) tmp = Float64(x + t); else tmp = Float64(Float64(t * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 4.6e+128) tmp = x + t; else tmp = (t * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 4.6e+128], N[(x + t), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{+128}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\end{array}
\end{array}
if y < 4.59999999999999996e128Initial program 79.5%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 4.59999999999999996e128 < y Initial program 79.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6416.4
Applied rewrites16.4%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + 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 + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}
\\
x + t
\end{array}
Initial program 79.5%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
herbie shell --seed 2025156
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))