
(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 13 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 (/ 1.0 (- a z))) (t_2 (* (- y z) t)) (t_3 (+ x (/ t_2 (- a z)))))
(if (<= t_3 -4e+263)
(fma (- y z) (* t t_1) x)
(if (<= t_3 5e+299) (fma t_2 t_1 x) (fma (- y z) (/ t (- a z)) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 1.0 / (a - z);
double t_2 = (y - z) * t;
double t_3 = x + (t_2 / (a - z));
double tmp;
if (t_3 <= -4e+263) {
tmp = fma((y - z), (t * t_1), x);
} else if (t_3 <= 5e+299) {
tmp = fma(t_2, t_1, x);
} else {
tmp = fma((y - z), (t / (a - z)), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(1.0 / Float64(a - z)) t_2 = Float64(Float64(y - z) * t) t_3 = Float64(x + Float64(t_2 / Float64(a - z))) tmp = 0.0 if (t_3 <= -4e+263) tmp = fma(Float64(y - z), Float64(t * t_1), x); elseif (t_3 <= 5e+299) tmp = fma(t_2, t_1, x); else tmp = fma(Float64(y - z), Float64(t / Float64(a - z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(t$95$2 / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -4e+263], N[(N[(y - z), $MachinePrecision] * N[(t * t$95$1), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$3, 5e+299], N[(t$95$2 * t$95$1 + x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{a - z}\\
t_2 := \left(y - z\right) \cdot t\\
t_3 := x + \frac{t\_2}{a - z}\\
\mathbf{if}\;t\_3 \leq -4 \cdot 10^{+263}:\\
\;\;\;\;\mathsf{fma}\left(y - z, t \cdot t\_1, x\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, t\_1, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) < -4.00000000000000006e263Initial program 85.2%
Applied rewrites95.9%
Applied rewrites95.9%
if -4.00000000000000006e263 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) < 5.0000000000000003e299Initial program 85.2%
Applied rewrites85.2%
if 5.0000000000000003e299 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) Initial program 85.2%
Applied rewrites95.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t (- a z)) x))
(t_2 (* (- y z) t))
(t_3 (+ x (/ t_2 (- a z)))))
(if (<= t_3 -4e+263)
t_1
(if (<= t_3 5e+299) (fma t_2 (/ 1.0 (- a z)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / (a - z)), x);
double t_2 = (y - z) * t;
double t_3 = x + (t_2 / (a - z));
double tmp;
if (t_3 <= -4e+263) {
tmp = t_1;
} else if (t_3 <= 5e+299) {
tmp = fma(t_2, (1.0 / (a - z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / Float64(a - z)), x) t_2 = Float64(Float64(y - z) * t) t_3 = Float64(x + Float64(t_2 / Float64(a - z))) tmp = 0.0 if (t_3 <= -4e+263) tmp = t_1; elseif (t_3 <= 5e+299) tmp = fma(t_2, Float64(1.0 / Float64(a - z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(t$95$2 / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -4e+263], t$95$1, If[LessEqual[t$95$3, 5e+299], N[(t$95$2 * N[(1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)\\
t_2 := \left(y - z\right) \cdot t\\
t_3 := x + \frac{t\_2}{a - z}\\
\mathbf{if}\;t\_3 \leq -4 \cdot 10^{+263}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, \frac{1}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) < -4.00000000000000006e263 or 5.0000000000000003e299 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) Initial program 85.2%
Applied rewrites95.9%
if -4.00000000000000006e263 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) < 5.0000000000000003e299Initial program 85.2%
Applied rewrites85.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t (- a z)) x))
(t_2 (+ x (/ (* (- y z) t) (- a z)))))
(if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 5e+299) t_2 t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / (a - z)), x);
double t_2 = x + (((y - z) * t) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / Float64(a - z)), x) 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 <= 5e+299) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $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, 5e+299], t$95$2, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a - z}, x\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 5 \cdot 10^{+299}:\\
\;\;\;\;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 5.0000000000000003e299 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) Initial program 85.2%
Applied rewrites95.9%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))) < 5.0000000000000003e299Initial program 85.2%
(FPCore (x y z t a) :precision binary64 (fma (- y z) (/ t (- a z)) x))
double code(double x, double y, double z, double t, double a) {
return fma((y - z), (t / (a - z)), x);
}
function code(x, y, z, t, a) return fma(Float64(y - z), Float64(t / Float64(a - z)), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)
\end{array}
Initial program 85.2%
Applied rewrites95.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e+84) (+ x t) (if (<= z 3.25e+74) (+ x (/ (* t y) (- a z))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+84) {
tmp = x + t;
} else if (z <= 3.25e+74) {
tmp = x + ((t * y) / (a - z));
} 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) :: tmp
if (z <= (-1.6d+84)) then
tmp = x + t
else if (z <= 3.25d+74) then
tmp = x + ((t * y) / (a - z))
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 tmp;
if (z <= -1.6e+84) {
tmp = x + t;
} else if (z <= 3.25e+74) {
tmp = x + ((t * y) / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+84: tmp = x + t elif z <= 3.25e+74: tmp = x + ((t * y) / (a - z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+84) tmp = Float64(x + t); elseif (z <= 3.25e+74) tmp = Float64(x + Float64(Float64(t * y) / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e+84) tmp = x + t; elseif (z <= 3.25e+74) tmp = x + ((t * y) / (a - z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+84], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.25e+74], N[(x + N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+84}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+74}:\\
\;\;\;\;x + \frac{t \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.60000000000000005e84 or 3.24999999999999981e74 < z Initial program 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
if -1.60000000000000005e84 < z < 3.24999999999999981e74Initial program 85.2%
Taylor expanded in y around inf
Applied rewrites73.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+60) (+ x t) (if (<= z 1.6e-12) (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.1e+60) {
tmp = x + t;
} else if (z <= 1.6e-12) {
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.1e+60) tmp = Float64(x + t); elseif (z <= 1.6e-12) 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.1e+60], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.6e-12], 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.1 \cdot 10^{+60}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.1000000000000001e60 or 1.6e-12 < z Initial program 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
if -2.1000000000000001e60 < z < 1.6e-12Initial program 85.2%
Applied rewrites95.9%
Taylor expanded in z around 0
Applied rewrites61.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.2e+77) (+ x t) (if (<= z 1.6e-12) (+ x (* t (/ y a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.2e+77) {
tmp = x + t;
} else if (z <= 1.6e-12) {
tmp = x + (t * (y / a));
} 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) :: tmp
if (z <= (-9.2d+77)) then
tmp = x + t
else if (z <= 1.6d-12) then
tmp = x + (t * (y / a))
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 tmp;
if (z <= -9.2e+77) {
tmp = x + t;
} else if (z <= 1.6e-12) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.2e+77: tmp = x + t elif z <= 1.6e-12: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.2e+77) tmp = Float64(x + t); elseif (z <= 1.6e-12) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.2e+77) tmp = x + t; elseif (z <= 1.6e-12) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.2e+77], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.6e-12], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+77}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-12}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -9.19999999999999979e77 or 1.6e-12 < z Initial program 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
if -9.19999999999999979e77 < z < 1.6e-12Initial program 85.2%
Taylor expanded in z around 0
Applied rewrites59.9%
Applied rewrites62.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (/ y (- a z))))) (if (<= y -1.3e+137) t_1 (if (<= y 5.2e+202) (+ 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.3e+137) {
tmp = t_1;
} else if (y <= 5.2e+202) {
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.3d+137)) then
tmp = t_1
else if (y <= 5.2d+202) 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.3e+137) {
tmp = t_1;
} else if (y <= 5.2e+202) {
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.3e+137: tmp = t_1 elif y <= 5.2e+202: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / Float64(a - z))) tmp = 0.0 if (y <= -1.3e+137) tmp = t_1; elseif (y <= 5.2e+202) 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.3e+137) tmp = t_1; elseif (y <= 5.2e+202) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+137], t$95$1, If[LessEqual[y, 5.2e+202], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a - z}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+202}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.3e137 or 5.2000000000000004e202 < y Initial program 85.2%
Applied rewrites95.9%
Taylor expanded in y around inf
Applied rewrites26.7%
Applied rewrites29.3%
if -1.3e137 < y < 5.2000000000000004e202Initial program 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* t y) (- a z)))) (if (<= y -1.3e+137) t_1 (if (<= y 1.96e+213) (+ 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.3e+137) {
tmp = t_1;
} else if (y <= 1.96e+213) {
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.3d+137)) then
tmp = t_1
else if (y <= 1.96d+213) 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.3e+137) {
tmp = t_1;
} else if (y <= 1.96e+213) {
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.3e+137: tmp = t_1 elif y <= 1.96e+213: 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.3e+137) tmp = t_1; elseif (y <= 1.96e+213) 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.3e+137) tmp = t_1; elseif (y <= 1.96e+213) 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.3e+137], t$95$1, If[LessEqual[y, 1.96e+213], 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.3 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.96 \cdot 10^{+213}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.3e137 or 1.9599999999999999e213 < y Initial program 85.2%
Taylor expanded in y around inf
Applied rewrites26.7%
if -1.3e137 < y < 1.9599999999999999e213Initial program 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e-113) (+ x t) (if (<= z 1.2e-283) (* x 1.0) (if (<= z 1.95e-225) (* t (/ y a)) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e-113) {
tmp = x + t;
} else if (z <= 1.2e-283) {
tmp = x * 1.0;
} else if (z <= 1.95e-225) {
tmp = t * (y / a);
} 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) :: tmp
if (z <= (-1.1d-113)) then
tmp = x + t
else if (z <= 1.2d-283) then
tmp = x * 1.0d0
else if (z <= 1.95d-225) then
tmp = t * (y / a)
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 tmp;
if (z <= -1.1e-113) {
tmp = x + t;
} else if (z <= 1.2e-283) {
tmp = x * 1.0;
} else if (z <= 1.95e-225) {
tmp = t * (y / a);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e-113: tmp = x + t elif z <= 1.2e-283: tmp = x * 1.0 elif z <= 1.95e-225: tmp = t * (y / a) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e-113) tmp = Float64(x + t); elseif (z <= 1.2e-283) tmp = Float64(x * 1.0); elseif (z <= 1.95e-225) tmp = Float64(t * Float64(y / a)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e-113) tmp = x + t; elseif (z <= 1.2e-283) tmp = x * 1.0; elseif (z <= 1.95e-225) tmp = t * (y / a); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e-113], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.2e-283], N[(x * 1.0), $MachinePrecision], If[LessEqual[z, 1.95e-225], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-113}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-283}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-225}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.10000000000000002e-113 or 1.95e-225 < z Initial program 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
if -1.10000000000000002e-113 < z < 1.2e-283Initial program 85.2%
Applied rewrites95.9%
Taylor expanded in x around inf
Applied rewrites78.4%
Taylor expanded in x around inf
Applied rewrites50.0%
if 1.2e-283 < z < 1.95e-225Initial program 85.2%
Applied rewrites95.9%
Taylor expanded in t around inf
Applied rewrites50.0%
Taylor expanded in z around 0
Applied rewrites20.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e-113) (+ x t) (if (<= z 1.26e-152) (* x 1.0) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e-113) {
tmp = x + t;
} else if (z <= 1.26e-152) {
tmp = x * 1.0;
} 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) :: tmp
if (z <= (-1.1d-113)) then
tmp = x + t
else if (z <= 1.26d-152) then
tmp = x * 1.0d0
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 tmp;
if (z <= -1.1e-113) {
tmp = x + t;
} else if (z <= 1.26e-152) {
tmp = x * 1.0;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e-113: tmp = x + t elif z <= 1.26e-152: tmp = x * 1.0 else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e-113) tmp = Float64(x + t); elseif (z <= 1.26e-152) tmp = Float64(x * 1.0); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e-113) tmp = x + t; elseif (z <= 1.26e-152) tmp = x * 1.0; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e-113], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.26e-152], N[(x * 1.0), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-113}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{-152}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.10000000000000002e-113 or 1.2600000000000001e-152 < z Initial program 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
if -1.10000000000000002e-113 < z < 1.2600000000000001e-152Initial program 85.2%
Applied rewrites95.9%
Taylor expanded in x around inf
Applied rewrites78.4%
Taylor expanded in x around inf
Applied rewrites50.0%
(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 85.2%
Taylor expanded in z around inf
Applied rewrites59.9%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 85.2%
Applied rewrites95.9%
Taylor expanded in t around inf
Applied rewrites50.0%
Taylor expanded in z around inf
Applied rewrites18.7%
Taylor expanded in z around inf
Applied rewrites18.7%
herbie shell --seed 2025161
(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))))