
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
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)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
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)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= a -2000.0) (fma (- z t) (/ y a) x) (+ x (/ (* y (- z t)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2000.0) {
tmp = fma((z - t), (y / a), x);
} else {
tmp = x + ((y * (z - t)) / a);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2000.0) tmp = fma(Float64(z - t), Float64(y / a), x); else tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2000.0], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2000:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\end{array}
\end{array}
if a < -2e3Initial program 87.6%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6497.2
Applied rewrites97.2%
if -2e3 < a Initial program 95.7%
(FPCore (x y z t a) :precision binary64 (fma (- z t) (/ y a) x))
double code(double x, double y, double z, double t, double a) {
return fma((z - t), (y / a), x);
}
function code(x, y, z, t, a) return fma(Float64(z - t), Float64(y / a), x) end
code[x_, y_, z_, t_, a_] := N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)
\end{array}
Initial program 93.7%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6497.3
Applied rewrites97.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- t) (/ y a) x))) (if (<= t -9.8e+185) t_1 (if (<= t 1.12e+87) (fma (/ y a) z x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-t, (y / a), x);
double tmp;
if (t <= -9.8e+185) {
tmp = t_1;
} else if (t <= 1.12e+87) {
tmp = fma((y / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-t), Float64(y / a), x) tmp = 0.0 if (t <= -9.8e+185) tmp = t_1; elseif (t <= 1.12e+87) tmp = fma(Float64(y / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-t) * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -9.8e+185], t$95$1, If[LessEqual[t, 1.12e+87], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, \frac{y}{a}, x\right)\\
\mathbf{if}\;t \leq -9.8 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.79999999999999968e185 or 1.12000000000000002e87 < t Initial program 90.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6497.4
Applied rewrites97.4%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6488.6
Applied rewrites88.6%
if -9.79999999999999968e185 < t < 1.12000000000000002e87Initial program 95.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6481.7
Applied rewrites81.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (/ (* (- z t) y) a))) (if (<= t_1 -4e+104) t_2 (if (<= t_1 5e+137) (fma y (/ z a) x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = ((z - t) * y) / a;
double tmp;
if (t_1 <= -4e+104) {
tmp = t_2;
} else if (t_1 <= 5e+137) {
tmp = fma(y, (z / a), x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(Float64(Float64(z - t) * y) / a) tmp = 0.0 if (t_1 <= -4e+104) tmp = t_2; elseif (t_1 <= 5e+137) tmp = fma(y, Float64(z / a), x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+104], t$95$2, If[LessEqual[t$95$1, 5e+137], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -4e104 or 5.0000000000000002e137 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 87.7%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6481.5
Applied rewrites81.5%
if -4e104 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000002e137Initial program 99.4%
Taylor expanded in z around inf
Applied rewrites83.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6482.6
Applied rewrites82.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* y (/ t a))))) (if (<= t -9.8e+185) t_1 (if (<= t 2.25e+91) (fma (/ y a) z x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (t / a));
double tmp;
if (t <= -9.8e+185) {
tmp = t_1;
} else if (t <= 2.25e+91) {
tmp = fma((y / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(t / a))) tmp = 0.0 if (t <= -9.8e+185) tmp = t_1; elseif (t <= 2.25e+91) tmp = fma(Float64(y / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.8e+185], t$95$1, If[LessEqual[t, 2.25e+91], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t}{a}\\
\mathbf{if}\;t \leq -9.8 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.79999999999999968e185 or 2.25e91 < t Initial program 90.1%
Taylor expanded in z around 0
cancel-sign-subN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.2
Applied rewrites82.2%
if -9.79999999999999968e185 < t < 2.25e91Initial program 95.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6481.6
Applied rewrites81.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) (- t)))) (if (<= t -3.8e+206) t_1 (if (<= t 1.95e+89) (fma (/ y a) z x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * -t;
double tmp;
if (t <= -3.8e+206) {
tmp = t_1;
} else if (t <= 1.95e+89) {
tmp = fma((y / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(-t)) tmp = 0.0 if (t <= -3.8e+206) tmp = t_1; elseif (t <= 1.95e+89) tmp = fma(Float64(y / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision]}, If[LessEqual[t, -3.8e+206], t$95$1, If[LessEqual[t, 1.95e+89], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(-t\right)\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+206}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.7999999999999999e206 or 1.95000000000000005e89 < t Initial program 90.2%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6464.3
Applied rewrites64.3%
if -3.7999999999999999e206 < t < 1.95000000000000005e89Initial program 94.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) a)))
(if (<= t_1 -4e+104)
(* (/ y a) (- t))
(if (<= t_1 5e+137)
x
(if (<= t_1 5e+286) (/ (* (- t) y) a) (* (/ y a) z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -4e+104) {
tmp = (y / a) * -t;
} else if (t_1 <= 5e+137) {
tmp = x;
} else if (t_1 <= 5e+286) {
tmp = (-t * y) / a;
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / a
if (t_1 <= (-4d+104)) then
tmp = (y / a) * -t
else if (t_1 <= 5d+137) then
tmp = x
else if (t_1 <= 5d+286) then
tmp = (-t * y) / a
else
tmp = (y / a) * 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;
double tmp;
if (t_1 <= -4e+104) {
tmp = (y / a) * -t;
} else if (t_1 <= 5e+137) {
tmp = x;
} else if (t_1 <= 5e+286) {
tmp = (-t * y) / a;
} else {
tmp = (y / a) * z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -4e+104: tmp = (y / a) * -t elif t_1 <= 5e+137: tmp = x elif t_1 <= 5e+286: tmp = (-t * y) / a else: tmp = (y / a) * z return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -4e+104) tmp = Float64(Float64(y / a) * Float64(-t)); elseif (t_1 <= 5e+137) tmp = x; elseif (t_1 <= 5e+286) tmp = Float64(Float64(Float64(-t) * y) / a); else tmp = Float64(Float64(y / a) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -4e+104) tmp = (y / a) * -t; elseif (t_1 <= 5e+137) tmp = x; elseif (t_1 <= 5e+286) tmp = (-t * y) / a; else tmp = (y / a) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+104], N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[t$95$1, 5e+137], x, If[LessEqual[t$95$1, 5e+286], N[(N[((-t) * y), $MachinePrecision] / a), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+104}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+137}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+286}:\\
\;\;\;\;\frac{\left(-t\right) \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot z\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -4e104Initial program 87.5%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6451.9
Applied rewrites51.9%
if -4e104 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000002e137Initial program 99.4%
Taylor expanded in x around inf
Applied rewrites67.7%
if 5.0000000000000002e137 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000004e286Initial program 99.6%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6494.2
Applied rewrites94.2%
Taylor expanded in t around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-*.f64N/A
lift-/.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
lower-*.f6444.2
Applied rewrites44.2%
if 5.0000000000000004e286 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 83.3%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lift-/.f6457.8
Applied rewrites57.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) a)))
(if (<= t_1 -4e+104)
(* (/ y a) (- t))
(if (<= t_1 4e+26) x (* (/ y a) z)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -4e+104) {
tmp = (y / a) * -t;
} else if (t_1 <= 4e+26) {
tmp = x;
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / a
if (t_1 <= (-4d+104)) then
tmp = (y / a) * -t
else if (t_1 <= 4d+26) then
tmp = x
else
tmp = (y / a) * 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;
double tmp;
if (t_1 <= -4e+104) {
tmp = (y / a) * -t;
} else if (t_1 <= 4e+26) {
tmp = x;
} else {
tmp = (y / a) * z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -4e+104: tmp = (y / a) * -t elif t_1 <= 4e+26: tmp = x else: tmp = (y / a) * z return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -4e+104) tmp = Float64(Float64(y / a) * Float64(-t)); elseif (t_1 <= 4e+26) tmp = x; else tmp = Float64(Float64(y / a) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -4e+104) tmp = (y / a) * -t; elseif (t_1 <= 4e+26) tmp = x; else tmp = (y / a) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+104], N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[t$95$1, 4e+26], x, N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+104}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot z\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -4e104Initial program 87.5%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6451.9
Applied rewrites51.9%
if -4e104 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.00000000000000019e26Initial program 99.4%
Taylor expanded in x around inf
Applied rewrites72.2%
if 4.00000000000000019e26 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 90.4%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6498.1
Applied rewrites98.1%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (/ y a) z))) (if (<= t_1 -4e+104) t_2 (if (<= t_1 4e+26) x t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = (y / a) * z;
double tmp;
if (t_1 <= -4e+104) {
tmp = t_2;
} else if (t_1 <= 4e+26) {
tmp = x;
} 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 * (z - t)) / a
t_2 = (y / a) * z
if (t_1 <= (-4d+104)) then
tmp = t_2
else if (t_1 <= 4d+26) then
tmp = x
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 * (z - t)) / a;
double t_2 = (y / a) * z;
double tmp;
if (t_1 <= -4e+104) {
tmp = t_2;
} else if (t_1 <= 4e+26) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = (y / a) * z tmp = 0 if t_1 <= -4e+104: tmp = t_2 elif t_1 <= 4e+26: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(Float64(y / a) * z) tmp = 0.0 if (t_1 <= -4e+104) tmp = t_2; elseif (t_1 <= 4e+26) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = (y / a) * z; tmp = 0.0; if (t_1 <= -4e+104) tmp = t_2; elseif (t_1 <= 4e+26) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+104], t$95$2, If[LessEqual[t$95$1, 4e+26], x, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{y}{a} \cdot z\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -4e104 or 4.00000000000000019e26 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 89.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lift-/.f6448.9
Applied rewrites48.9%
if -4e104 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.00000000000000019e26Initial program 99.4%
Taylor expanded in x around inf
Applied rewrites72.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a))) (if (<= t_1 -4e+104) (* (/ z a) y) (if (<= t_1 4e+26) x (/ (* z y) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -4e+104) {
tmp = (z / a) * y;
} else if (t_1 <= 4e+26) {
tmp = x;
} else {
tmp = (z * 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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / a
if (t_1 <= (-4d+104)) then
tmp = (z / a) * y
else if (t_1 <= 4d+26) then
tmp = x
else
tmp = (z * y) / a
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;
double tmp;
if (t_1 <= -4e+104) {
tmp = (z / a) * y;
} else if (t_1 <= 4e+26) {
tmp = x;
} else {
tmp = (z * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -4e+104: tmp = (z / a) * y elif t_1 <= 4e+26: tmp = x else: tmp = (z * y) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -4e+104) tmp = Float64(Float64(z / a) * y); elseif (t_1 <= 4e+26) tmp = x; else tmp = Float64(Float64(z * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -4e+104) tmp = (z / a) * y; elseif (t_1 <= 4e+26) tmp = x; else tmp = (z * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+104], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 4e+26], x, N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+104}:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -4e104Initial program 87.5%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6444.6
Applied rewrites44.6%
if -4e104 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.00000000000000019e26Initial program 99.4%
Taylor expanded in x around inf
Applied rewrites72.2%
if 4.00000000000000019e26 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 90.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6443.2
Applied rewrites43.2%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6443.5
Applied rewrites43.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (/ z a) y))) (if (<= t_1 -4e+104) t_2 (if (<= t_1 4e+26) x t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = (z / a) * y;
double tmp;
if (t_1 <= -4e+104) {
tmp = t_2;
} else if (t_1 <= 4e+26) {
tmp = x;
} 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 * (z - t)) / a
t_2 = (z / a) * y
if (t_1 <= (-4d+104)) then
tmp = t_2
else if (t_1 <= 4d+26) then
tmp = x
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 * (z - t)) / a;
double t_2 = (z / a) * y;
double tmp;
if (t_1 <= -4e+104) {
tmp = t_2;
} else if (t_1 <= 4e+26) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = (z / a) * y tmp = 0 if t_1 <= -4e+104: tmp = t_2 elif t_1 <= 4e+26: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(Float64(z / a) * y) tmp = 0.0 if (t_1 <= -4e+104) tmp = t_2; elseif (t_1 <= 4e+26) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = (z / a) * y; tmp = 0.0; if (t_1 <= -4e+104) tmp = t_2; elseif (t_1 <= 4e+26) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+104], t$95$2, If[LessEqual[t$95$1, 4e+26], x, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{z}{a} \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -4e104 or 4.00000000000000019e26 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 89.1%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6443.8
Applied rewrites43.8%
if -4e104 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.00000000000000019e26Initial program 99.4%
Taylor expanded in x around inf
Applied rewrites72.2%
(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 93.7%
Taylor expanded in x around inf
Applied rewrites39.4%
herbie shell --seed 2025115
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
(+ x (/ (* y (- z t)) a)))