
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+306)))
(* (/ x (- t z)) (- y z))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+306)) {
tmp = (x / (t - z)) * (y - z);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+306)) {
tmp = (x / (t - z)) * (y - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y - z)) / (t - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+306): tmp = (x / (t - z)) * (y - z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+306)) tmp = Float64(Float64(x / Float64(t - z)) * Float64(y - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y - z)) / (t - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+306))) tmp = (x / (t - z)) * (y - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+306]], $MachinePrecision]], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+306}\right):\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0 or 1.00000000000000002e306 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 30.3%
Applied rewrites99.8%
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.00000000000000002e306Initial program 98.7%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z y) (/ x z))))
(if (<= z -0.054)
t_1
(if (<= z 620000000.0)
(* (/ x (- t z)) y)
(if (<= z 4.4e+164) t_1 (* 1.0 x))))))
double code(double x, double y, double z, double t) {
double t_1 = (z - y) * (x / z);
double tmp;
if (z <= -0.054) {
tmp = t_1;
} else if (z <= 620000000.0) {
tmp = (x / (t - z)) * y;
} else if (z <= 4.4e+164) {
tmp = t_1;
} else {
tmp = 1.0 * 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 = (z - y) * (x / z)
if (z <= (-0.054d0)) then
tmp = t_1
else if (z <= 620000000.0d0) then
tmp = (x / (t - z)) * y
else if (z <= 4.4d+164) then
tmp = t_1
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z - y) * (x / z);
double tmp;
if (z <= -0.054) {
tmp = t_1;
} else if (z <= 620000000.0) {
tmp = (x / (t - z)) * y;
} else if (z <= 4.4e+164) {
tmp = t_1;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z - y) * (x / z) tmp = 0 if z <= -0.054: tmp = t_1 elif z <= 620000000.0: tmp = (x / (t - z)) * y elif z <= 4.4e+164: tmp = t_1 else: tmp = 1.0 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z - y) * Float64(x / z)) tmp = 0.0 if (z <= -0.054) tmp = t_1; elseif (z <= 620000000.0) tmp = Float64(Float64(x / Float64(t - z)) * y); elseif (z <= 4.4e+164) tmp = t_1; else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z - y) * (x / z); tmp = 0.0; if (z <= -0.054) tmp = t_1; elseif (z <= 620000000.0) tmp = (x / (t - z)) * y; elseif (z <= 4.4e+164) tmp = t_1; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z - y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.054], t$95$1, If[LessEqual[z, 620000000.0], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 4.4e+164], t$95$1, N[(1.0 * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - y\right) \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -0.054:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 620000000:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -0.0539999999999999994 or 6.2e8 < z < 4.40000000000000011e164Initial program 82.8%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6473.3
Applied rewrites73.3%
Applied rewrites62.0%
if -0.0539999999999999994 < z < 6.2e8Initial program 93.2%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6482.6
Applied rewrites82.6%
if 4.40000000000000011e164 < z Initial program 46.9%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6493.6
Applied rewrites93.6%
Taylor expanded in y around 0
Applied rewrites88.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z y) (/ x z))))
(if (<= z -2.55e-48)
t_1
(if (<= z 0.055)
(/ (* (- y z) x) t)
(if (<= z 4.4e+164) t_1 (* 1.0 x))))))
double code(double x, double y, double z, double t) {
double t_1 = (z - y) * (x / z);
double tmp;
if (z <= -2.55e-48) {
tmp = t_1;
} else if (z <= 0.055) {
tmp = ((y - z) * x) / t;
} else if (z <= 4.4e+164) {
tmp = t_1;
} else {
tmp = 1.0 * 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 = (z - y) * (x / z)
if (z <= (-2.55d-48)) then
tmp = t_1
else if (z <= 0.055d0) then
tmp = ((y - z) * x) / t
else if (z <= 4.4d+164) then
tmp = t_1
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z - y) * (x / z);
double tmp;
if (z <= -2.55e-48) {
tmp = t_1;
} else if (z <= 0.055) {
tmp = ((y - z) * x) / t;
} else if (z <= 4.4e+164) {
tmp = t_1;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z - y) * (x / z) tmp = 0 if z <= -2.55e-48: tmp = t_1 elif z <= 0.055: tmp = ((y - z) * x) / t elif z <= 4.4e+164: tmp = t_1 else: tmp = 1.0 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z - y) * Float64(x / z)) tmp = 0.0 if (z <= -2.55e-48) tmp = t_1; elseif (z <= 0.055) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (z <= 4.4e+164) tmp = t_1; else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z - y) * (x / z); tmp = 0.0; if (z <= -2.55e-48) tmp = t_1; elseif (z <= 0.055) tmp = ((y - z) * x) / t; elseif (z <= 4.4e+164) tmp = t_1; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z - y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e-48], t$95$1, If[LessEqual[z, 0.055], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4.4e+164], t$95$1, N[(1.0 * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - y\right) \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -2.55 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.055:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -2.55000000000000006e-48 or 0.0550000000000000003 < z < 4.40000000000000011e164Initial program 83.1%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6471.1
Applied rewrites71.1%
Applied rewrites61.1%
if -2.55000000000000006e-48 < z < 0.0550000000000000003Initial program 94.1%
Applied rewrites92.2%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.6
Applied rewrites75.6%
if 4.40000000000000011e164 < z Initial program 46.9%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6493.6
Applied rewrites93.6%
Taylor expanded in y around 0
Applied rewrites88.1%
Final simplification71.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.3e+168) (not (<= z 2e+102))) (* (/ (- z y) z) x) (* (/ x (- t z)) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.3e+168) || !(z <= 2e+102)) {
tmp = ((z - y) / z) * x;
} else {
tmp = (x / (t - z)) * (y - z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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 <= (-3.3d+168)) .or. (.not. (z <= 2d+102))) then
tmp = ((z - y) / z) * x
else
tmp = (x / (t - z)) * (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.3e+168) || !(z <= 2e+102)) {
tmp = ((z - y) / z) * x;
} else {
tmp = (x / (t - z)) * (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.3e+168) or not (z <= 2e+102): tmp = ((z - y) / z) * x else: tmp = (x / (t - z)) * (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.3e+168) || !(z <= 2e+102)) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = Float64(Float64(x / Float64(t - z)) * Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.3e+168) || ~((z <= 2e+102))) tmp = ((z - y) / z) * x; else tmp = (x / (t - z)) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.3e+168], N[Not[LessEqual[z, 2e+102]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+168} \lor \neg \left(z \leq 2 \cdot 10^{+102}\right):\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if z < -3.2999999999999999e168 or 1.99999999999999995e102 < z Initial program 61.7%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6491.3
Applied rewrites91.3%
if -3.2999999999999999e168 < z < 1.99999999999999995e102Initial program 92.0%
Applied rewrites94.2%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.054) (not (<= z 1150000000.0))) (* (/ (- z y) z) x) (* (/ x (- t z)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.054) || !(z <= 1150000000.0)) {
tmp = ((z - y) / z) * x;
} else {
tmp = (x / (t - z)) * 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 <= (-0.054d0)) .or. (.not. (z <= 1150000000.0d0))) then
tmp = ((z - y) / z) * x
else
tmp = (x / (t - z)) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.054) || !(z <= 1150000000.0)) {
tmp = ((z - y) / z) * x;
} else {
tmp = (x / (t - z)) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.054) or not (z <= 1150000000.0): tmp = ((z - y) / z) * x else: tmp = (x / (t - z)) * y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.054) || !(z <= 1150000000.0)) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = Float64(Float64(x / Float64(t - z)) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.054) || ~((z <= 1150000000.0))) tmp = ((z - y) / z) * x; else tmp = (x / (t - z)) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.054], N[Not[LessEqual[z, 1150000000.0]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.054 \lor \neg \left(z \leq 1150000000\right):\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\end{array}
\end{array}
if z < -0.0539999999999999994 or 1.15e9 < z Initial program 73.3%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6478.7
Applied rewrites78.7%
if -0.0539999999999999994 < z < 1.15e9Initial program 93.2%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6482.6
Applied rewrites82.6%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -10500000.0) (not (<= z 1.05e+25))) (* 1.0 x) (/ (* (- y z) x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -10500000.0) || !(z <= 1.05e+25)) {
tmp = 1.0 * x;
} else {
tmp = ((y - z) * x) / t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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 <= (-10500000.0d0)) .or. (.not. (z <= 1.05d+25))) then
tmp = 1.0d0 * x
else
tmp = ((y - z) * x) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -10500000.0) || !(z <= 1.05e+25)) {
tmp = 1.0 * x;
} else {
tmp = ((y - z) * x) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -10500000.0) or not (z <= 1.05e+25): tmp = 1.0 * x else: tmp = ((y - z) * x) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -10500000.0) || !(z <= 1.05e+25)) tmp = Float64(1.0 * x); else tmp = Float64(Float64(Float64(y - z) * x) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -10500000.0) || ~((z <= 1.05e+25))) tmp = 1.0 * x; else tmp = ((y - z) * x) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -10500000.0], N[Not[LessEqual[z, 1.05e+25]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10500000 \lor \neg \left(z \leq 1.05 \cdot 10^{+25}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\end{array}
\end{array}
if z < -1.05e7 or 1.05e25 < z Initial program 71.9%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6481.2
Applied rewrites81.2%
Taylor expanded in y around 0
Applied rewrites62.2%
if -1.05e7 < z < 1.05e25Initial program 93.0%
Applied rewrites93.5%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.1
Applied rewrites69.1%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.054) (not (<= z 1.4e+22))) (* 1.0 x) (* (/ x t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.054) || !(z <= 1.4e+22)) {
tmp = 1.0 * x;
} else {
tmp = (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 <= (-0.054d0)) .or. (.not. (z <= 1.4d+22))) then
tmp = 1.0d0 * x
else
tmp = (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 <= -0.054) || !(z <= 1.4e+22)) {
tmp = 1.0 * x;
} else {
tmp = (x / t) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.054) or not (z <= 1.4e+22): tmp = 1.0 * x else: tmp = (x / t) * y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.054) || !(z <= 1.4e+22)) tmp = Float64(1.0 * x); else tmp = Float64(Float64(x / t) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.054) || ~((z <= 1.4e+22))) tmp = 1.0 * x; else tmp = (x / t) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.054], N[Not[LessEqual[z, 1.4e+22]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.054 \lor \neg \left(z \leq 1.4 \cdot 10^{+22}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\end{array}
\end{array}
if z < -0.0539999999999999994 or 1.4e22 < z Initial program 72.8%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6480.1
Applied rewrites80.1%
Taylor expanded in y around 0
Applied rewrites61.6%
if -0.0539999999999999994 < z < 1.4e22Initial program 92.8%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6461.6
Applied rewrites61.6%
Applied rewrites63.6%
Final simplification62.6%
(FPCore (x y z t) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 83.2%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in y around 0
Applied rewrites33.2%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (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 - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2025016
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))