
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ t (- a z)) (- y z))) (t_2 (+ x (/ (* (- y z) t) (- a z))))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 2e+307) t_2 t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * (y - z);
double t_2 = x + (((y - z) * t) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 2e+307) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (a - z)) * (y - z);
double t_2 = x + (((y - z) * t) / (a - z));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 2e+307) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t / (a - z)) * (y - z) t_2 = x + (((y - z) * t) / (a - z)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 2e+307: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t / Float64(a - z)) * Float64(y - z)) t_2 = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 2e+307) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t / (a - z)) * (y - z); t_2 = x + (((y - z) * t) / (a - z)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 2e+307) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 2e+307], t$95$2, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{a - z} \cdot \left(y - z\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) < -inf.0 or 1.99999999999999997e307 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) Initial program 39.9%
Taylor expanded in x around 0
associate-/l*N/A
sub-divN/A
sub-divN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6487.5
Applied rewrites87.5%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) < 1.99999999999999997e307Initial program 99.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* (/ z (- a z)) t)))) (if (<= z -9.5e+68) t_1 (if (<= z 1.4e-11) (fma y (/ t (- a z)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((z / (a - z)) * t);
double tmp;
if (z <= -9.5e+68) {
tmp = t_1;
} else if (z <= 1.4e-11) {
tmp = fma(y, (t / (a - z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(z / Float64(a - z)) * t)) tmp = 0.0 if (z <= -9.5e+68) tmp = t_1; elseif (z <= 1.4e-11) tmp = fma(y, Float64(t / Float64(a - z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+68], t$95$1, If[LessEqual[z, 1.4e-11], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{z}{a - z} \cdot t\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.50000000000000069e68 or 1.4e-11 < z Initial program 73.6%
Taylor expanded in y around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
fp-cancel-sub-signN/A
associate-/l*N/A
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6486.3
Applied rewrites86.3%
if -9.50000000000000069e68 < z < 1.4e-11Initial program 95.5%
Taylor expanded in y around inf
Applied rewrites86.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f6488.2
Applied rewrites88.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.2e+86) (+ x t) (if (<= z 8e+104) (fma y (/ t (- a z)) x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.2e+86) {
tmp = x + t;
} else if (z <= 8e+104) {
tmp = fma(y, (t / (a - z)), x);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.2e+86) tmp = Float64(x + t); elseif (z <= 8e+104) tmp = fma(y, Float64(t / Float64(a - z)), x); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.2e+86], N[(x + t), $MachinePrecision], If[LessEqual[z, 8e+104], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+86}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -9.19999999999999958e86 or 8e104 < z Initial program 68.6%
Taylor expanded in z around inf
Applied rewrites82.8%
if -9.19999999999999958e86 < z < 8e104Initial program 94.5%
Taylor expanded in y around inf
Applied rewrites83.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f6486.0
Applied rewrites86.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.2e+84) (+ x t) (if (<= z 1.8e-11) (fma (- y z) (/ t a) x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+84) {
tmp = x + t;
} else if (z <= 1.8e-11) {
tmp = fma((y - z), (t / a), x);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e+84) tmp = Float64(x + t); elseif (z <= 1.8e-11) tmp = fma(Float64(y - z), Float64(t / a), x); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e+84], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.8e-11], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+84}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.1999999999999998e84 or 1.79999999999999992e-11 < z Initial program 73.0%
Taylor expanded in z around inf
Applied rewrites78.2%
if -2.1999999999999998e84 < z < 1.79999999999999992e-11Initial program 95.4%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6478.0
Applied rewrites78.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.65e+84) (+ x t) (if (<= z 5.8e+104) (fma y (/ t a) x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e+84) {
tmp = x + t;
} else if (z <= 5.8e+104) {
tmp = fma(y, (t / a), x);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e+84) tmp = Float64(x + t); elseif (z <= 5.8e+104) tmp = fma(y, Float64(t / a), x); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e+84], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.8e+104], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+84}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.65000000000000008e84 or 5.7999999999999997e104 < z Initial program 68.7%
Taylor expanded in z around inf
Applied rewrites82.7%
if -1.65000000000000008e84 < z < 5.7999999999999997e104Initial program 94.5%
Taylor expanded in y around inf
Applied rewrites83.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f6486.0
Applied rewrites86.0%
Taylor expanded in z around 0
Applied rewrites72.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.65e+84) (+ x t) (if (<= z 7.6e+104) (fma (/ y a) t x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e+84) {
tmp = x + t;
} else if (z <= 7.6e+104) {
tmp = fma((y / a), t, x);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e+84) tmp = Float64(x + t); elseif (z <= 7.6e+104) tmp = fma(Float64(y / a), t, x); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e+84], N[(x + t), $MachinePrecision], If[LessEqual[z, 7.6e+104], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+84}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.65000000000000008e84 or 7.59999999999999938e104 < z Initial program 68.7%
Taylor expanded in z around inf
Applied rewrites82.7%
if -1.65000000000000008e84 < z < 7.59999999999999938e104Initial program 94.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6472.3
Applied rewrites72.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (<= t_1 -2e-34)
(+ x t)
(if (<= t_1 3e-141) x (if (<= t_1 2e+285) (+ x t) (* (/ y (- z)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 3e-141) {
tmp = x;
} else if (t_1 <= 2e+285) {
tmp = x + t;
} else {
tmp = (y / -z) * 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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * t) / (a - z)
if (t_1 <= (-2d-34)) then
tmp = x + t
else if (t_1 <= 3d-141) then
tmp = x
else if (t_1 <= 2d+285) then
tmp = x + t
else
tmp = (y / -z) * t
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) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 3e-141) {
tmp = x;
} else if (t_1 <= 2e+285) {
tmp = x + t;
} else {
tmp = (y / -z) * t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -2e-34: tmp = x + t elif t_1 <= 3e-141: tmp = x elif t_1 <= 2e+285: tmp = x + t else: tmp = (y / -z) * t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e-34) tmp = Float64(x + t); elseif (t_1 <= 3e-141) tmp = x; elseif (t_1 <= 2e+285) tmp = Float64(x + t); else tmp = Float64(Float64(y / Float64(-z)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -2e-34) tmp = x + t; elseif (t_1 <= 3e-141) tmp = x; elseif (t_1 <= 2e+285) tmp = x + t; else tmp = (y / -z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-34], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 3e-141], x, If[LessEqual[t$95$1, 2e+285], N[(x + t), $MachinePrecision], N[(N[(y / (-z)), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 3 \cdot 10^{-141}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+285}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{-z} \cdot t\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -1.99999999999999986e-34 or 2.99999999999999983e-141 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2e285Initial program 86.2%
Taylor expanded in z around inf
Applied rewrites52.1%
if -1.99999999999999986e-34 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.99999999999999983e-141Initial program 99.5%
Taylor expanded in x around inf
Applied rewrites84.1%
if 2e285 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 86.2%
Taylor expanded in y around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6436.9
Applied rewrites36.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6418.8
Applied rewrites18.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (<= t_1 -2e-34)
(+ x t)
(if (<= t_1 3e-141) x (if (<= t_1 1e+265) (+ x t) (* (/ y a) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 3e-141) {
tmp = x;
} else if (t_1 <= 1e+265) {
tmp = x + t;
} else {
tmp = (y / 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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * t) / (a - z)
if (t_1 <= (-2d-34)) then
tmp = x + t
else if (t_1 <= 3d-141) then
tmp = x
else if (t_1 <= 1d+265) then
tmp = x + t
else
tmp = (y / a) * t
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) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 3e-141) {
tmp = x;
} else if (t_1 <= 1e+265) {
tmp = x + t;
} else {
tmp = (y / a) * t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -2e-34: tmp = x + t elif t_1 <= 3e-141: tmp = x elif t_1 <= 1e+265: tmp = x + t else: tmp = (y / a) * t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e-34) tmp = Float64(x + t); elseif (t_1 <= 3e-141) tmp = x; elseif (t_1 <= 1e+265) tmp = Float64(x + t); else tmp = Float64(Float64(y / a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -2e-34) tmp = x + t; elseif (t_1 <= 3e-141) tmp = x; elseif (t_1 <= 1e+265) tmp = x + t; else tmp = (y / a) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-34], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 3e-141], x, If[LessEqual[t$95$1, 1e+265], N[(x + t), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 3 \cdot 10^{-141}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+265}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -1.99999999999999986e-34 or 2.99999999999999983e-141 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.00000000000000007e265Initial program 86.0%
Taylor expanded in z around inf
Applied rewrites52.3%
if -1.99999999999999986e-34 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.99999999999999983e-141Initial program 99.5%
Taylor expanded in x around inf
Applied rewrites84.1%
if 1.00000000000000007e265 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 86.0%
Taylor expanded in y around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6436.7
Applied rewrites36.7%
Taylor expanded in z around 0
Applied rewrites25.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* (- y z) t) (- a z)))) (if (<= t_1 -2e-34) (+ x t) (if (<= t_1 5e+133) x (/ (* t y) (- z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 5e+133) {
tmp = x;
} else {
tmp = (t * y) / -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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * t) / (a - z)
if (t_1 <= (-2d-34)) then
tmp = x + t
else if (t_1 <= 5d+133) then
tmp = x
else
tmp = (t * y) / -z
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) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 5e+133) {
tmp = x;
} else {
tmp = (t * y) / -z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -2e-34: tmp = x + t elif t_1 <= 5e+133: tmp = x else: tmp = (t * y) / -z return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e-34) tmp = Float64(x + t); elseif (t_1 <= 5e+133) tmp = x; else tmp = Float64(Float64(t * y) / Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -2e-34) tmp = x + t; elseif (t_1 <= 5e+133) tmp = x; else tmp = (t * y) / -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-34], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 5e+133], x, N[(N[(t * y), $MachinePrecision] / (-z)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+133}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{-z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -1.99999999999999986e-34Initial program 74.1%
Taylor expanded in z around inf
Applied rewrites47.0%
if -1.99999999999999986e-34 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.99999999999999961e133Initial program 99.6%
Taylor expanded in x around inf
Applied rewrites74.0%
if 4.99999999999999961e133 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 57.5%
Taylor expanded in y around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6451.9
Applied rewrites51.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6430.8
Applied rewrites30.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lower-/.f64N/A
lift-*.f6428.0
Applied rewrites28.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* (- y z) t) (- a z)))) (if (<= t_1 -2e-34) (+ x t) (if (<= t_1 3e-141) x (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 3e-141) {
tmp = x;
} else {
tmp = x + 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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * t) / (a - z)
if (t_1 <= (-2d-34)) then
tmp = x + t
else if (t_1 <= 3d-141) then
tmp = x
else
tmp = x + t
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) * t) / (a - z);
double tmp;
if (t_1 <= -2e-34) {
tmp = x + t;
} else if (t_1 <= 3e-141) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -2e-34: tmp = x + t elif t_1 <= 3e-141: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e-34) tmp = Float64(x + t); elseif (t_1 <= 3e-141) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -2e-34) tmp = x + t; elseif (t_1 <= 3e-141) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-34], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 3e-141], x, N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 3 \cdot 10^{-141}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -1.99999999999999986e-34 or 2.99999999999999983e-141 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 77.2%
Taylor expanded in z around inf
Applied rewrites49.8%
if -1.99999999999999986e-34 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.99999999999999983e-141Initial program 99.5%
Taylor expanded in x around inf
Applied rewrites84.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* (- y z) t) (- a z)))) (if (<= t_1 -2e+252) t (if (<= t_1 5e+156) x t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -2e+252) {
tmp = t;
} else if (t_1 <= 5e+156) {
tmp = x;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * t) / (a - z)
if (t_1 <= (-2d+252)) then
tmp = t
else if (t_1 <= 5d+156) then
tmp = x
else
tmp = t
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) * t) / (a - z);
double tmp;
if (t_1 <= -2e+252) {
tmp = t;
} else if (t_1 <= 5e+156) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -2e+252: tmp = t elif t_1 <= 5e+156: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e+252) tmp = t; elseif (t_1 <= 5e+156) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -2e+252) tmp = t; elseif (t_1 <= 5e+156) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+252], t, If[LessEqual[t$95$1, 5e+156], x, t]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+252}:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+156}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -2.0000000000000002e252 or 4.99999999999999992e156 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 50.5%
Taylor expanded in x around 0
associate-/l*N/A
sub-divN/A
sub-divN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6485.2
Applied rewrites85.2%
Taylor expanded in z around inf
*-commutative30.3
associate-/l*30.3
Applied rewrites30.3%
if -2.0000000000000002e252 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.99999999999999992e156Initial program 99.6%
Taylor expanded in x around inf
Applied rewrites66.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.6%
Taylor expanded in x around inf
Applied rewrites51.0%
herbie shell --seed 2025130
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
(+ x (/ (* (- y z) t) (- a z))))