
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (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 = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (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 = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift--.f64100.0
Applied rewrites100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- t x) y x)) (t_2 (fma (- y z) t x)))
(if (<= t -62.0)
t_2
(if (<= t -6.6e-94)
t_1
(if (<= t 3.3e-208) (* (+ 1.0 z) x) (if (<= t 4.8e-8) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = fma((t - x), y, x);
double t_2 = fma((y - z), t, x);
double tmp;
if (t <= -62.0) {
tmp = t_2;
} else if (t <= -6.6e-94) {
tmp = t_1;
} else if (t <= 3.3e-208) {
tmp = (1.0 + z) * x;
} else if (t <= 4.8e-8) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(t - x), y, x) t_2 = fma(Float64(y - z), t, x) tmp = 0.0 if (t <= -62.0) tmp = t_2; elseif (t <= -6.6e-94) tmp = t_1; elseif (t <= 3.3e-208) tmp = Float64(Float64(1.0 + z) * x); elseif (t <= 4.8e-8) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t + x), $MachinePrecision]}, If[LessEqual[t, -62.0], t$95$2, If[LessEqual[t, -6.6e-94], t$95$1, If[LessEqual[t, 3.3e-208], N[(N[(1.0 + z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 4.8e-8], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, y, x\right)\\
t_2 := \mathsf{fma}\left(y - z, t, x\right)\\
\mathbf{if}\;t \leq -62:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -6.6 \cdot 10^{-94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-208}:\\
\;\;\;\;\left(1 + z\right) \cdot x\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -62 or 4.79999999999999997e-8 < t Initial program 100.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift--.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites85.0%
if -62 < t < -6.6000000000000003e-94 or 3.30000000000000006e-208 < t < 4.79999999999999997e-8Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6461.9
Applied rewrites61.9%
if -6.6000000000000003e-94 < t < 3.30000000000000006e-208Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6486.9
Applied rewrites86.9%
Taylor expanded in y around 0
lower-+.f6456.7
Applied rewrites56.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t x) y)) (t_2 (* (- y z) t)))
(if (<= y -2.6e+19)
t_1
(if (<= y -3e-80)
t_2
(if (<= y 1.45e-119) (* (+ 1.0 z) x) (if (<= y 1.28e+22) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (t - x) * y;
double t_2 = (y - z) * t;
double tmp;
if (y <= -2.6e+19) {
tmp = t_1;
} else if (y <= -3e-80) {
tmp = t_2;
} else if (y <= 1.45e-119) {
tmp = (1.0 + z) * x;
} else if (y <= 1.28e+22) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (t - x) * y
t_2 = (y - z) * t
if (y <= (-2.6d+19)) then
tmp = t_1
else if (y <= (-3d-80)) then
tmp = t_2
else if (y <= 1.45d-119) then
tmp = (1.0d0 + z) * x
else if (y <= 1.28d+22) then
tmp = t_2
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 - x) * y;
double t_2 = (y - z) * t;
double tmp;
if (y <= -2.6e+19) {
tmp = t_1;
} else if (y <= -3e-80) {
tmp = t_2;
} else if (y <= 1.45e-119) {
tmp = (1.0 + z) * x;
} else if (y <= 1.28e+22) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t - x) * y t_2 = (y - z) * t tmp = 0 if y <= -2.6e+19: tmp = t_1 elif y <= -3e-80: tmp = t_2 elif y <= 1.45e-119: tmp = (1.0 + z) * x elif y <= 1.28e+22: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t - x) * y) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (y <= -2.6e+19) tmp = t_1; elseif (y <= -3e-80) tmp = t_2; elseif (y <= 1.45e-119) tmp = Float64(Float64(1.0 + z) * x); elseif (y <= 1.28e+22) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t - x) * y; t_2 = (y - z) * t; tmp = 0.0; if (y <= -2.6e+19) tmp = t_1; elseif (y <= -3e-80) tmp = t_2; elseif (y <= 1.45e-119) tmp = (1.0 + z) * x; elseif (y <= 1.28e+22) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -2.6e+19], t$95$1, If[LessEqual[y, -3e-80], t$95$2, If[LessEqual[y, 1.45e-119], N[(N[(1.0 + z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 1.28e+22], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot y\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-80}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-119}:\\
\;\;\;\;\left(1 + z\right) \cdot x\\
\mathbf{elif}\;y \leq 1.28 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.6e19 or 1.28e22 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6480.5
Applied rewrites80.5%
if -2.6e19 < y < -3.00000000000000007e-80 or 1.45e-119 < y < 1.28e22Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6450.3
Applied rewrites50.3%
if -3.00000000000000007e-80 < y < 1.45e-119Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6461.2
Applied rewrites61.2%
Taylor expanded in y around 0
lower-+.f6461.2
Applied rewrites61.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2400000000.0) (not (<= x 4.6e-96))) (* (- 1.0 (- y z)) x) (fma (- y z) t x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2400000000.0) || !(x <= 4.6e-96)) {
tmp = (1.0 - (y - z)) * x;
} else {
tmp = fma((y - z), t, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((x <= -2400000000.0) || !(x <= 4.6e-96)) tmp = Float64(Float64(1.0 - Float64(y - z)) * x); else tmp = fma(Float64(y - z), t, x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2400000000.0], N[Not[LessEqual[x, 4.6e-96]], $MachinePrecision]], N[(N[(1.0 - N[(y - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2400000000 \lor \neg \left(x \leq 4.6 \cdot 10^{-96}\right):\\
\;\;\;\;\left(1 - \left(y - z\right)\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, t, x\right)\\
\end{array}
\end{array}
if x < -2.4e9 or 4.6e-96 < x Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6478.1
Applied rewrites78.1%
if -2.4e9 < x < 4.6e-96Initial program 100.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift--.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites85.1%
Final simplification81.1%
(FPCore (x y z t) :precision binary64 (if (<= y -7.8e-55) (* t y) (if (<= y 2.2e-21) x (if (<= y 1.08e+58) (* z x) (* t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e-55) {
tmp = t * y;
} else if (y <= 2.2e-21) {
tmp = x;
} else if (y <= 1.08e+58) {
tmp = z * x;
} else {
tmp = 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 (y <= (-7.8d-55)) then
tmp = t * y
else if (y <= 2.2d-21) then
tmp = x
else if (y <= 1.08d+58) then
tmp = z * x
else
tmp = t * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e-55) {
tmp = t * y;
} else if (y <= 2.2e-21) {
tmp = x;
} else if (y <= 1.08e+58) {
tmp = z * x;
} else {
tmp = t * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.8e-55: tmp = t * y elif y <= 2.2e-21: tmp = x elif y <= 1.08e+58: tmp = z * x else: tmp = t * y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.8e-55) tmp = Float64(t * y); elseif (y <= 2.2e-21) tmp = x; elseif (y <= 1.08e+58) tmp = Float64(z * x); else tmp = Float64(t * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.8e-55) tmp = t * y; elseif (y <= 2.2e-21) tmp = x; elseif (y <= 1.08e+58) tmp = z * x; else tmp = t * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.8e-55], N[(t * y), $MachinePrecision], If[LessEqual[y, 2.2e-21], x, If[LessEqual[y, 1.08e+58], N[(z * x), $MachinePrecision], N[(t * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-55}:\\
\;\;\;\;t \cdot y\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.08 \cdot 10^{+58}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;t \cdot y\\
\end{array}
\end{array}
if y < -7.8e-55 or 1.0799999999999999e58 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6475.8
Applied rewrites75.8%
Taylor expanded in x around 0
Applied rewrites42.6%
if -7.8e-55 < y < 2.2000000000000001e-21Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in y around 0
Applied rewrites34.5%
if 2.2000000000000001e-21 < y < 1.0799999999999999e58Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
Taylor expanded in z around inf
Applied rewrites26.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -600.0) (not (<= z 700000000000.0))) (* (- z) (- t x)) (fma (- t x) y x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -600.0) || !(z <= 700000000000.0)) {
tmp = -z * (t - x);
} else {
tmp = fma((t - x), y, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((z <= -600.0) || !(z <= 700000000000.0)) tmp = Float64(Float64(-z) * Float64(t - x)); else tmp = fma(Float64(t - x), y, x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -600.0], N[Not[LessEqual[z, 700000000000.0]], $MachinePrecision]], N[((-z) * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -600 \lor \neg \left(z \leq 700000000000\right):\\
\;\;\;\;\left(-z\right) \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
\end{array}
\end{array}
if z < -600 or 7e11 < z Initial program 100.0%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6478.6
Applied rewrites78.6%
if -600 < z < 7e11Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6489.4
Applied rewrites89.4%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.5) (not (<= z 9e+67))) (* (- y z) t) (fma (- t x) y x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5) || !(z <= 9e+67)) {
tmp = (y - z) * t;
} else {
tmp = fma((t - x), y, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.5) || !(z <= 9e+67)) tmp = Float64(Float64(y - z) * t); else tmp = fma(Float64(t - x), y, x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.5], N[Not[LessEqual[z, 9e+67]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \lor \neg \left(z \leq 9 \cdot 10^{+67}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
\end{array}
\end{array}
if z < -6.5 or 8.9999999999999997e67 < z Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6453.2
Applied rewrites53.2%
if -6.5 < z < 8.9999999999999997e67Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6486.2
Applied rewrites86.2%
Final simplification71.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.8e-55) (not (<= y 1.15e+51))) (* (- t x) y) (* (+ 1.0 z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.8e-55) || !(y <= 1.15e+51)) {
tmp = (t - x) * y;
} else {
tmp = (1.0 + z) * 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 ((y <= (-7.8d-55)) .or. (.not. (y <= 1.15d+51))) then
tmp = (t - x) * y
else
tmp = (1.0d0 + z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.8e-55) || !(y <= 1.15e+51)) {
tmp = (t - x) * y;
} else {
tmp = (1.0 + z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.8e-55) or not (y <= 1.15e+51): tmp = (t - x) * y else: tmp = (1.0 + z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.8e-55) || !(y <= 1.15e+51)) tmp = Float64(Float64(t - x) * y); else tmp = Float64(Float64(1.0 + z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.8e-55) || ~((y <= 1.15e+51))) tmp = (t - x) * y; else tmp = (1.0 + z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.8e-55], N[Not[LessEqual[y, 1.15e+51]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision], N[(N[(1.0 + z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-55} \lor \neg \left(y \leq 1.15 \cdot 10^{+51}\right):\\
\;\;\;\;\left(t - x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(1 + z\right) \cdot x\\
\end{array}
\end{array}
if y < -7.8e-55 or 1.15000000000000003e51 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6475.7
Applied rewrites75.7%
if -7.8e-55 < y < 1.15000000000000003e51Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6458.9
Applied rewrites58.9%
Taylor expanded in y around 0
lower-+.f6457.0
Applied rewrites57.0%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (<= z -600.0) (* (+ 1.0 z) x) (if (<= z 1.5e+30) (fma t y x) (* (- z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -600.0) {
tmp = (1.0 + z) * x;
} else if (z <= 1.5e+30) {
tmp = fma(t, y, x);
} else {
tmp = -z * t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -600.0) tmp = Float64(Float64(1.0 + z) * x); elseif (z <= 1.5e+30) tmp = fma(t, y, x); else tmp = Float64(Float64(-z) * t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -600.0], N[(N[(1.0 + z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.5e+30], N[(t * y + x), $MachinePrecision], N[((-z) * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -600:\\
\;\;\;\;\left(1 + z\right) \cdot x\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) \cdot t\\
\end{array}
\end{array}
if z < -600Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
lower-+.f6443.0
Applied rewrites43.0%
if -600 < z < 1.49999999999999989e30Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6488.4
Applied rewrites88.4%
Taylor expanded in x around 0
Applied rewrites65.9%
if 1.49999999999999989e30 < z Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6444.0
Applied rewrites44.0%
(FPCore (x y z t) :precision binary64 (if (<= z -600.0) (* z x) (if (<= z 1.5e+30) (fma t y x) (* (- z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -600.0) {
tmp = z * x;
} else if (z <= 1.5e+30) {
tmp = fma(t, y, x);
} else {
tmp = -z * t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -600.0) tmp = Float64(z * x); elseif (z <= 1.5e+30) tmp = fma(t, y, x); else tmp = Float64(Float64(-z) * t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -600.0], N[(z * x), $MachinePrecision], If[LessEqual[z, 1.5e+30], N[(t * y + x), $MachinePrecision], N[((-z) * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -600:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) \cdot t\\
\end{array}
\end{array}
if z < -600Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6454.0
Applied rewrites54.0%
Taylor expanded in z around inf
Applied rewrites42.7%
if -600 < z < 1.49999999999999989e30Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6488.4
Applied rewrites88.4%
Taylor expanded in x around 0
Applied rewrites65.9%
if 1.49999999999999989e30 < z Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6444.0
Applied rewrites44.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -600.0) (not (<= z 2e+117))) (* z x) (fma t y x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -600.0) || !(z <= 2e+117)) {
tmp = z * x;
} else {
tmp = fma(t, y, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((z <= -600.0) || !(z <= 2e+117)) tmp = Float64(z * x); else tmp = fma(t, y, x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -600.0], N[Not[LessEqual[z, 2e+117]], $MachinePrecision]], N[(z * x), $MachinePrecision], N[(t * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -600 \lor \neg \left(z \leq 2 \cdot 10^{+117}\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
\end{array}
\end{array}
if z < -600 or 2.0000000000000001e117 < z Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6453.7
Applied rewrites53.7%
Taylor expanded in z around inf
Applied rewrites44.2%
if -600 < z < 2.0000000000000001e117Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6482.9
Applied rewrites82.9%
Taylor expanded in x around 0
Applied rewrites60.9%
Final simplification54.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.0032) (not (<= z 1.6e-33))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0032) || !(z <= 1.6e-33)) {
tmp = z * x;
} else {
tmp = 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 ((z <= (-0.0032d0)) .or. (.not. (z <= 1.6d-33))) then
tmp = z * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0032) || !(z <= 1.6e-33)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.0032) or not (z <= 1.6e-33): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.0032) || !(z <= 1.6e-33)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.0032) || ~((z <= 1.6e-33))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.0032], N[Not[LessEqual[z, 1.6e-33]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0032 \lor \neg \left(z \leq 1.6 \cdot 10^{-33}\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.00320000000000000015 or 1.59999999999999988e-33 < z Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lift--.f6452.7
Applied rewrites52.7%
Taylor expanded in z around inf
Applied rewrites39.5%
if -0.00320000000000000015 < z < 1.59999999999999988e-33Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6491.8
Applied rewrites91.8%
Taylor expanded in y around 0
Applied rewrites34.4%
Final simplification37.1%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
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)
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6460.2
Applied rewrites60.2%
Taylor expanded in y around 0
Applied rewrites18.0%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - 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 + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2025086
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
(+ x (* (- y z) (- t x))))