
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 (- INFINITY)) (* y (/ x z)) (* x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (x / z);
} else {
tmp = x * t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (x / z);
} else {
tmp = x * t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= -math.inf: tmp = y * (x / z) else: tmp = x * t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x * t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (x / z); else tmp = x * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * t$95$1), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1\\
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.8%
Applied rewrites60.8%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (fabs x) (- (/ y z) (/ t (- 1.0 z))))))
(*
(copysign 1.0 x)
(if (<= t_1 (- INFINITY))
(/ (/ (* (fma (- z 1.0) y (* t z)) (fabs x)) (- z 1.0)) z)
t_1))))double code(double x, double y, double z, double t) {
double t_1 = fabs(x) * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((fma((z - 1.0), y, (t * z)) * fabs(x)) / (z - 1.0)) / z;
} else {
tmp = t_1;
}
return copysign(1.0, x) * tmp;
}
function code(x, y, z, t) t_1 = Float64(abs(x) * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(fma(Float64(z - 1.0), y, Float64(t * z)) * abs(x)) / Float64(z - 1.0)) / z); else tmp = t_1; end return Float64(copysign(1.0, x) * tmp) end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Abs[x], $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(N[(z - 1.0), $MachinePrecision] * y + N[(t * z), $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]), $MachinePrecision]]
\begin{array}{l}
t_1 := \left|x\right| \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(z - 1, y, t \cdot z\right) \cdot \left|x\right|}{z - 1}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < -inf.0Initial program 94.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites73.5%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) Initial program 94.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y (* -1.0 t)) z))))
(if (<= z -116.0)
t_1
(if (<= z 7700000.0) (* x (- (/ y z) t)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x * ((y - (-1.0 * t)) / z);
double tmp;
if (z <= -116.0) {
tmp = t_1;
} else if (z <= 7700000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = x * ((y - ((-1.0d0) * t)) / z)
if (z <= (-116.0d0)) then
tmp = t_1
else if (z <= 7700000.0d0) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - (-1.0 * t)) / z);
double tmp;
if (z <= -116.0) {
tmp = t_1;
} else if (z <= 7700000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - (-1.0 * t)) / z) tmp = 0 if z <= -116.0: tmp = t_1 elif z <= 7700000.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - Float64(-1.0 * t)) / z)) tmp = 0.0 if (z <= -116.0) tmp = t_1; elseif (z <= 7700000.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - (-1.0 * t)) / z); tmp = 0.0; if (z <= -116.0) tmp = t_1; elseif (z <= 7700000.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -116.0], t$95$1, If[LessEqual[z, 7700000.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot \frac{y - -1 \cdot t}{z}\\
\mathbf{if}\;z \leq -116:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7700000:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -116 or 7.7e6 < z Initial program 94.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower-*.f6473.6%
Applied rewrites73.6%
if -116 < z < 7.7e6Initial program 94.9%
Taylor expanded in z around 0
Applied rewrites64.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -116.0)
(/ (* x (+ y t)) z)
(if (<= z 7700000.0)
(* x (- (/ y z) t))
(* (/ 1.0 z) (* x (+ t y))))))double code(double x, double y, double z, double t) {
double tmp;
if (z <= -116.0) {
tmp = (x * (y + t)) / z;
} else if (z <= 7700000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (1.0 / z) * (x * (t + y));
}
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)
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) :: tmp
if (z <= (-116.0d0)) then
tmp = (x * (y + t)) / z
else if (z <= 7700000.0d0) then
tmp = x * ((y / z) - t)
else
tmp = (1.0d0 / z) * (x * (t + y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -116.0) {
tmp = (x * (y + t)) / z;
} else if (z <= 7700000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (1.0 / z) * (x * (t + y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -116.0: tmp = (x * (y + t)) / z elif z <= 7700000.0: tmp = x * ((y / z) - t) else: tmp = (1.0 / z) * (x * (t + y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -116.0) tmp = Float64(Float64(x * Float64(y + t)) / z); elseif (z <= 7700000.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(1.0 / z) * Float64(x * Float64(t + y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -116.0) tmp = (x * (y + t)) / z; elseif (z <= 7700000.0) tmp = x * ((y / z) - t); else tmp = (1.0 / z) * (x * (t + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -116.0], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 7700000.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(x * N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -116:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;z \leq 7700000:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot \left(t + y\right)\right)\\
\end{array}
if z < -116Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6470.5%
Applied rewrites70.5%
if -116 < z < 7.7e6Initial program 94.9%
Taylor expanded in z around 0
Applied rewrites64.8%
if 7.7e6 < z Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6470.6%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6470.5%
Applied rewrites70.5%
(FPCore (x y z t) :precision binary64 (if (<= z -116.0) (/ (* x (+ y t)) z) (if (<= z 9500000.0) (* x (- (/ y z) t)) (/ (fma t x (* x y)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -116.0) {
tmp = (x * (y + t)) / z;
} else if (z <= 9500000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = fma(t, x, (x * y)) / z;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -116.0) tmp = Float64(Float64(x * Float64(y + t)) / z); elseif (z <= 9500000.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(fma(t, x, Float64(x * y)) / z); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -116.0], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 9500000.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(t * x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -116:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;z \leq 9500000:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, x \cdot y\right)}{z}\\
\end{array}
if z < -116Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6470.5%
Applied rewrites70.5%
if -116 < z < 9.5e6Initial program 94.9%
Taylor expanded in z around 0
Applied rewrites64.8%
if 9.5e6 < z Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (+ y t)) z)))
(if (<= z -116.0)
t_1
(if (<= z 7700000.0) (* x (- (/ y z) t)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x * (y + t)) / z;
double tmp;
if (z <= -116.0) {
tmp = t_1;
} else if (z <= 7700000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (x * (y + t)) / z
if (z <= (-116.0d0)) then
tmp = t_1
else if (z <= 7700000.0d0) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y + t)) / z;
double tmp;
if (z <= -116.0) {
tmp = t_1;
} else if (z <= 7700000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y + t)) / z tmp = 0 if z <= -116.0: tmp = t_1 elif z <= 7700000.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y + t)) / z) tmp = 0.0 if (z <= -116.0) tmp = t_1; elseif (z <= 7700000.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y + t)) / z; tmp = 0.0; if (z <= -116.0) tmp = t_1; elseif (z <= 7700000.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -116.0], t$95$1, If[LessEqual[z, 7700000.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{if}\;z \leq -116:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7700000:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -116 or 7.7e6 < z Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6470.5%
Applied rewrites70.5%
if -116 < z < 7.7e6Initial program 94.9%
Taylor expanded in z around 0
Applied rewrites64.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ t (- z 1.0)) x)))
(if (<= t -4e+148)
t_1
(if (<= t -3.9e-72)
(/ (* x (+ y t)) z)
(if (<= t 1.05e+55) (* (/ y z) x) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = (t / (z - 1.0)) * x;
double tmp;
if (t <= -4e+148) {
tmp = t_1;
} else if (t <= -3.9e-72) {
tmp = (x * (y + t)) / z;
} else if (t <= 1.05e+55) {
tmp = (y / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (t / (z - 1.0d0)) * x
if (t <= (-4d+148)) then
tmp = t_1
else if (t <= (-3.9d-72)) then
tmp = (x * (y + t)) / z
else if (t <= 1.05d+55) then
tmp = (y / z) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / (z - 1.0)) * x;
double tmp;
if (t <= -4e+148) {
tmp = t_1;
} else if (t <= -3.9e-72) {
tmp = (x * (y + t)) / z;
} else if (t <= 1.05e+55) {
tmp = (y / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / (z - 1.0)) * x tmp = 0 if t <= -4e+148: tmp = t_1 elif t <= -3.9e-72: tmp = (x * (y + t)) / z elif t <= 1.05e+55: tmp = (y / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / Float64(z - 1.0)) * x) tmp = 0.0 if (t <= -4e+148) tmp = t_1; elseif (t <= -3.9e-72) tmp = Float64(Float64(x * Float64(y + t)) / z); elseif (t <= 1.05e+55) tmp = Float64(Float64(y / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / (z - 1.0)) * x; tmp = 0.0; if (t <= -4e+148) tmp = t_1; elseif (t <= -3.9e-72) tmp = (x * (y + t)) / z; elseif (t <= 1.05e+55) tmp = (y / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -4e+148], t$95$1, If[LessEqual[t, -3.9e-72], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 1.05e+55], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t}{z - 1} \cdot x\\
\mathbf{if}\;t \leq -4 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.9 \cdot 10^{-72}:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+55}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -4.0000000000000002e148 or 1.05e55 < t Initial program 94.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6445.7%
Applied rewrites45.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6445.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-/.f6445.7%
Applied rewrites45.7%
if -4.0000000000000002e148 < t < -3.9000000000000002e-72Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6470.5%
Applied rewrites70.5%
if -3.9000000000000002e-72 < t < 1.05e55Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6461.0%
Applied rewrites61.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* x (+ y t)) z))) (if (<= z -1.9e-72) t_1 (if (<= z 7700000.0) (* y (/ x z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y + t)) / z;
double tmp;
if (z <= -1.9e-72) {
tmp = t_1;
} else if (z <= 7700000.0) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (x * (y + t)) / z
if (z <= (-1.9d-72)) then
tmp = t_1
else if (z <= 7700000.0d0) then
tmp = y * (x / z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y + t)) / z;
double tmp;
if (z <= -1.9e-72) {
tmp = t_1;
} else if (z <= 7700000.0) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y + t)) / z tmp = 0 if z <= -1.9e-72: tmp = t_1 elif z <= 7700000.0: tmp = y * (x / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y + t)) / z) tmp = 0.0 if (z <= -1.9e-72) tmp = t_1; elseif (z <= 7700000.0) tmp = Float64(y * Float64(x / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y + t)) / z; tmp = 0.0; if (z <= -1.9e-72) tmp = t_1; elseif (z <= 7700000.0) tmp = y * (x / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.9e-72], t$95$1, If[LessEqual[z, 7700000.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7700000:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.9e-72 or 7.7e6 < z Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6470.5%
Applied rewrites70.5%
if -1.9e-72 < z < 7.7e6Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.8%
Applied rewrites60.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z y))))
(if (<= y -7e-118)
t_1
(if (<= y 3.6e+83) (/ (* t x) (- z 1.0)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x / (z / y);
double tmp;
if (y <= -7e-118) {
tmp = t_1;
} else if (y <= 3.6e+83) {
tmp = (t * x) / (z - 1.0);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = x / (z / y)
if (y <= (-7d-118)) then
tmp = t_1
else if (y <= 3.6d+83) then
tmp = (t * x) / (z - 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z / y);
double tmp;
if (y <= -7e-118) {
tmp = t_1;
} else if (y <= 3.6e+83) {
tmp = (t * x) / (z - 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / y) tmp = 0 if y <= -7e-118: tmp = t_1 elif y <= 3.6e+83: tmp = (t * x) / (z - 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / y)) tmp = 0.0 if (y <= -7e-118) tmp = t_1; elseif (y <= 3.6e+83) tmp = Float64(Float64(t * x) / Float64(z - 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / y); tmp = 0.0; if (y <= -7e-118) tmp = t_1; elseif (y <= 3.6e+83) tmp = (t * x) / (z - 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e-118], t$95$1, If[LessEqual[y, 3.6e+83], N[(N[(t * x), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{y}}\\
\mathbf{if}\;y \leq -7 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+83}:\\
\;\;\;\;\frac{t \cdot x}{z - 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -6.9999999999999997e-118 or 3.5999999999999997e83 < y Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6461.2%
Applied rewrites61.2%
if -6.9999999999999997e-118 < y < 3.5999999999999997e83Initial program 94.9%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6494.7%
Applied rewrites94.7%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
sub-flipN/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
distribute-rgt-outN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites91.8%
Taylor expanded in z around inf
lower-/.f6468.4%
Applied rewrites68.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.1%
Applied rewrites43.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -3.4e+47)
t_1
(if (<= t 3e+56)
(* (/ y z) x)
(if (<= t 1.04e+270) t_1 (* (- t) x))))))double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -3.4e+47) {
tmp = t_1;
} else if (t <= 3e+56) {
tmp = (y / z) * x;
} else if (t <= 1.04e+270) {
tmp = t_1;
} else {
tmp = -t * x;
}
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)
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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-3.4d+47)) then
tmp = t_1
else if (t <= 3d+56) then
tmp = (y / z) * x
else if (t <= 1.04d+270) then
tmp = t_1
else
tmp = -t * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -3.4e+47) {
tmp = t_1;
} else if (t <= 3e+56) {
tmp = (y / z) * x;
} else if (t <= 1.04e+270) {
tmp = t_1;
} else {
tmp = -t * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -3.4e+47: tmp = t_1 elif t <= 3e+56: tmp = (y / z) * x elif t <= 1.04e+270: tmp = t_1 else: tmp = -t * x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -3.4e+47) tmp = t_1; elseif (t <= 3e+56) tmp = Float64(Float64(y / z) * x); elseif (t <= 1.04e+270) tmp = t_1; else tmp = Float64(Float64(-t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -3.4e+47) tmp = t_1; elseif (t <= 3e+56) tmp = (y / z) * x; elseif (t <= 1.04e+270) tmp = t_1; else tmp = -t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e+47], t$95$1, If[LessEqual[t, 3e+56], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.04e+270], t$95$1, N[((-t) * x), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+56}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{+270}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot x\\
\end{array}
if t < -3.3999999999999998e47 or 3.0000000000000001e56 < t < 1.04e270Initial program 94.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6445.7%
Applied rewrites45.7%
Taylor expanded in z around 0
lower-*.f6423.4%
Applied rewrites23.4%
Taylor expanded in z around inf
lower-/.f6435.0%
Applied rewrites35.0%
if -3.3999999999999998e47 < t < 3.0000000000000001e56Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6461.0%
Applied rewrites61.0%
if 1.04e270 < t Initial program 94.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6445.7%
Applied rewrites45.7%
Taylor expanded in z around 0
lower-*.f6423.4%
Applied rewrites23.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6423.4%
Applied rewrites23.4%
(FPCore (x y z t) :precision binary64 (if (<= t 3e+56) (* (/ y z) x) (if (<= t 7e+233) (/ (* t x) z) (* (- t) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e+56) {
tmp = (y / z) * x;
} else if (t <= 7e+233) {
tmp = (t * x) / z;
} else {
tmp = -t * x;
}
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)
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) :: tmp
if (t <= 3d+56) then
tmp = (y / z) * x
else if (t <= 7d+233) then
tmp = (t * x) / z
else
tmp = -t * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e+56) {
tmp = (y / z) * x;
} else if (t <= 7e+233) {
tmp = (t * x) / z;
} else {
tmp = -t * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3e+56: tmp = (y / z) * x elif t <= 7e+233: tmp = (t * x) / z else: tmp = -t * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3e+56) tmp = Float64(Float64(y / z) * x); elseif (t <= 7e+233) tmp = Float64(Float64(t * x) / z); else tmp = Float64(Float64(-t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3e+56) tmp = (y / z) * x; elseif (t <= 7e+233) tmp = (t * x) / z; else tmp = -t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3e+56], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 7e+233], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], N[((-t) * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq 3 \cdot 10^{+56}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+233}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot x\\
\end{array}
if t < 3.0000000000000001e56Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6461.0%
Applied rewrites61.0%
if 3.0000000000000001e56 < t < 6.9999999999999996e233Initial program 94.9%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6491.6%
Applied rewrites91.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f6470.7%
Applied rewrites70.7%
Taylor expanded in y around 0
lower-*.f6432.5%
Applied rewrites32.5%
if 6.9999999999999996e233 < t Initial program 94.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6445.7%
Applied rewrites45.7%
Taylor expanded in z around 0
lower-*.f6423.4%
Applied rewrites23.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6423.4%
Applied rewrites23.4%
(FPCore (x y z t) :precision binary64 (if (<= t 1.6e+235) (* (/ y z) x) (* (- t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.6e+235) {
tmp = (y / z) * x;
} else {
tmp = -t * x;
}
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)
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) :: tmp
if (t <= 1.6d+235) then
tmp = (y / z) * x
else
tmp = -t * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.6e+235) {
tmp = (y / z) * x;
} else {
tmp = -t * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.6e+235: tmp = (y / z) * x else: tmp = -t * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.6e+235) tmp = Float64(Float64(y / z) * x); else tmp = Float64(Float64(-t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.6e+235) tmp = (y / z) * x; else tmp = -t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.6e+235], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], N[((-t) * x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;t \leq 1.6 \cdot 10^{+235}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot x\\
\end{array}
if t < 1.6e235Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6461.0%
Applied rewrites61.0%
if 1.6e235 < t Initial program 94.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6445.7%
Applied rewrites45.7%
Taylor expanded in z around 0
lower-*.f6423.4%
Applied rewrites23.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6423.4%
Applied rewrites23.4%
(FPCore (x y z t) :precision binary64 (if (<= t 1.6e+235) (* y (/ x z)) (* (- t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.6e+235) {
tmp = y * (x / z);
} else {
tmp = -t * x;
}
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)
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) :: tmp
if (t <= 1.6d+235) then
tmp = y * (x / z)
else
tmp = -t * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.6e+235) {
tmp = y * (x / z);
} else {
tmp = -t * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.6e+235: tmp = y * (x / z) else: tmp = -t * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.6e+235) tmp = Float64(y * Float64(x / z)); else tmp = Float64(Float64(-t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.6e+235) tmp = y * (x / z); else tmp = -t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.6e+235], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[((-t) * x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;t \leq 1.6 \cdot 10^{+235}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot x\\
\end{array}
if t < 1.6e235Initial program 94.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.1%
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.8%
Applied rewrites60.8%
if 1.6e235 < t Initial program 94.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6445.7%
Applied rewrites45.7%
Taylor expanded in z around 0
lower-*.f6423.4%
Applied rewrites23.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6423.4%
Applied rewrites23.4%
(FPCore (x y z t) :precision binary64 (* (- t) x))
double code(double x, double y, double z, double t) {
return -t * 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t * x
end function
public static double code(double x, double y, double z, double t) {
return -t * x;
}
def code(x, y, z, t): return -t * x
function code(x, y, z, t) return Float64(Float64(-t) * x) end
function tmp = code(x, y, z, t) tmp = -t * x; end
code[x_, y_, z_, t_] := N[((-t) * x), $MachinePrecision]
\left(-t\right) \cdot x
Initial program 94.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6445.7%
Applied rewrites45.7%
Taylor expanded in z around 0
lower-*.f6423.4%
Applied rewrites23.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6423.4%
Applied rewrites23.4%
herbie shell --seed 2025212
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
(* x (- (/ y z) (/ t (- 1.0 z)))))