
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
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 * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
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 * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= z -5e-25) (+ (- x (/ (/ y z) 3.0)) (/ t (* (* z 3.0) y))) (fma (- (/ t y) y) (/ 0.3333333333333333 z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e-25) {
tmp = (x - ((y / z) / 3.0)) + (t / ((z * 3.0) * y));
} else {
tmp = fma(((t / y) - y), (0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -5e-25) tmp = Float64(Float64(x - Float64(Float64(y / z) / 3.0)) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = fma(Float64(Float64(t / y) - y), Float64(0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e-25], N[(N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-25}:\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y} - y, \frac{0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if z < -4.99999999999999962e-25Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
if -4.99999999999999962e-25 < z Initial program 94.0%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites96.6%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6496.6
Applied rewrites96.6%
(FPCore (x y z t) :precision binary64 (if (<= z -7e+80) (+ (- x (/ (/ y 3.0) z)) (/ t (* (* z 3.0) y))) (fma (- (/ t y) y) (/ 0.3333333333333333 z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7e+80) {
tmp = (x - ((y / 3.0) / z)) + (t / ((z * 3.0) * y));
} else {
tmp = fma(((t / y) - y), (0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -7e+80) tmp = Float64(Float64(x - Float64(Float64(y / 3.0) / z)) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = fma(Float64(Float64(t / y) - y), Float64(0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -7e+80], N[(N[(x - N[(N[(y / 3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+80}:\\
\;\;\;\;\left(x - \frac{\frac{y}{3}}{z}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y} - y, \frac{0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if z < -6.99999999999999987e80Initial program 99.1%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.1
Applied rewrites99.1%
if -6.99999999999999987e80 < z Initial program 94.6%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites96.7%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6496.7
Applied rewrites96.7%
(FPCore (x y z t) :precision binary64 (if (<= z -7e+80) (- x (- (/ y (* 3.0 z)) (/ t (* (* 3.0 z) y)))) (fma (- (/ t y) y) (/ 0.3333333333333333 z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7e+80) {
tmp = x - ((y / (3.0 * z)) - (t / ((3.0 * z) * y)));
} else {
tmp = fma(((t / y) - y), (0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -7e+80) tmp = Float64(x - Float64(Float64(y / Float64(3.0 * z)) - Float64(t / Float64(Float64(3.0 * z) * y)))); else tmp = fma(Float64(Float64(t / y) - y), Float64(0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -7e+80], N[(x - N[(N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision] - N[(t / N[(N[(3.0 * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+80}:\\
\;\;\;\;x - \left(\frac{y}{3 \cdot z} - \frac{t}{\left(3 \cdot z\right) \cdot y}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y} - y, \frac{0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if z < -6.99999999999999987e80Initial program 99.1%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f6499.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.1
Applied rewrites99.1%
if -6.99999999999999987e80 < z Initial program 94.6%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites96.7%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6496.7
Applied rewrites96.7%
(FPCore (x y z t) :precision binary64 (fma (- (/ t y) y) (/ 0.3333333333333333 z) x))
double code(double x, double y, double z, double t) {
return fma(((t / y) - y), (0.3333333333333333 / z), x);
}
function code(x, y, z, t) return fma(Float64(Float64(t / y) - y), Float64(0.3333333333333333 / z), x) end
code[x_, y_, z_, t_] := N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{t}{y} - y, \frac{0.3333333333333333}{z}, x\right)
\end{array}
Initial program 95.4%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites95.3%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6495.3
Applied rewrites95.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- y) (/ 0.3333333333333333 z) x)))
(if (<= y -7e+23)
t_1
(if (<= y 7.2e+98) (fma (/ (/ t z) y) 0.3333333333333333 x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-y, (0.3333333333333333 / z), x);
double tmp;
if (y <= -7e+23) {
tmp = t_1;
} else if (y <= 7.2e+98) {
tmp = fma(((t / z) / y), 0.3333333333333333, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(-y), Float64(0.3333333333333333 / z), x) tmp = 0.0 if (y <= -7e+23) tmp = t_1; elseif (y <= 7.2e+98) tmp = fma(Float64(Float64(t / z) / y), 0.3333333333333333, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-y) * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -7e+23], t$95$1, If[LessEqual[y, 7.2e+98], N[(N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{t}{z}}{y}, 0.3333333333333333, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.0000000000000004e23 or 7.19999999999999962e98 < y Initial program 98.6%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites99.7%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6494.9
Applied rewrites94.9%
if -7.0000000000000004e23 < y < 7.19999999999999962e98Initial program 93.3%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites92.4%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lift-*.f6484.3
Applied rewrites84.3%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-/.f6488.8
Applied rewrites88.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- y) (/ 0.3333333333333333 z) x)))
(if (<= y -2.25e+24)
t_1
(if (<= y 7.2e+98) (fma (/ t (* z y)) 0.3333333333333333 x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-y, (0.3333333333333333 / z), x);
double tmp;
if (y <= -2.25e+24) {
tmp = t_1;
} else if (y <= 7.2e+98) {
tmp = fma((t / (z * y)), 0.3333333333333333, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(-y), Float64(0.3333333333333333 / z), x) tmp = 0.0 if (y <= -2.25e+24) tmp = t_1; elseif (y <= 7.2e+98) tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-y) * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -2.25e+24], t$95$1, If[LessEqual[y, 7.2e+98], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -2.25 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2500000000000001e24 or 7.19999999999999962e98 < y Initial program 98.6%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites99.7%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6494.9
Applied rewrites94.9%
if -2.2500000000000001e24 < y < 7.19999999999999962e98Initial program 93.3%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites92.4%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lift-*.f6484.2
Applied rewrites84.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- y) (/ 0.3333333333333333 z) x)))
(if (<= y -3.3e-57)
t_1
(if (<= y 3.1e-102) (/ (* t (/ 0.3333333333333333 z)) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-y, (0.3333333333333333 / z), x);
double tmp;
if (y <= -3.3e-57) {
tmp = t_1;
} else if (y <= 3.1e-102) {
tmp = (t * (0.3333333333333333 / z)) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(-y), Float64(0.3333333333333333 / z), x) tmp = 0.0 if (y <= -3.3e-57) tmp = t_1; elseif (y <= 3.1e-102) tmp = Float64(Float64(t * Float64(0.3333333333333333 / z)) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-y) * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -3.3e-57], t$95$1, If[LessEqual[y, 3.1e-102], N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-102}:\\
\;\;\;\;\frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2999999999999998e-57 or 3.10000000000000013e-102 < y Initial program 98.3%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites99.1%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.1
Applied rewrites99.1%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6483.2
Applied rewrites83.2%
if -3.2999999999999998e-57 < y < 3.10000000000000013e-102Initial program 90.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6461.1
Applied rewrites61.1%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f6468.8
Applied rewrites68.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- y) (/ 0.3333333333333333 z) x)))
(if (<= y -3.3e-57)
t_1
(if (<= y 3.1e-102) (* (/ t z) (/ 0.3333333333333333 y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-y, (0.3333333333333333 / z), x);
double tmp;
if (y <= -3.3e-57) {
tmp = t_1;
} else if (y <= 3.1e-102) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(-y), Float64(0.3333333333333333 / z), x) tmp = 0.0 if (y <= -3.3e-57) tmp = t_1; elseif (y <= 3.1e-102) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-y) * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -3.3e-57], t$95$1, If[LessEqual[y, 3.1e-102], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-102}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2999999999999998e-57 or 3.10000000000000013e-102 < y Initial program 98.3%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites99.1%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.1
Applied rewrites99.1%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6483.2
Applied rewrites83.2%
if -3.2999999999999998e-57 < y < 3.10000000000000013e-102Initial program 90.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
times-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6468.8
Applied rewrites68.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- y) (/ 0.3333333333333333 z) x)))
(if (<= y -3.3e-57)
t_1
(if (<= y 3.1e-102) (* (/ t (* z y)) 0.3333333333333333) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-y, (0.3333333333333333 / z), x);
double tmp;
if (y <= -3.3e-57) {
tmp = t_1;
} else if (y <= 3.1e-102) {
tmp = (t / (z * y)) * 0.3333333333333333;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(-y), Float64(0.3333333333333333 / z), x) tmp = 0.0 if (y <= -3.3e-57) tmp = t_1; elseif (y <= 3.1e-102) tmp = Float64(Float64(t / Float64(z * y)) * 0.3333333333333333); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-y) * N[(0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -3.3e-57], t$95$1, If[LessEqual[y, 3.1e-102], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-102}:\\
\;\;\;\;\frac{t}{z \cdot y} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2999999999999998e-57 or 3.10000000000000013e-102 < y Initial program 98.3%
Taylor expanded in x around 0
associate--l+N/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate-/r*N/A
sub-divN/A
associate-/l*N/A
distribute-lft-out--N/A
*-lft-identityN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
Applied rewrites99.1%
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.1
Applied rewrites99.1%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6483.2
Applied rewrites83.2%
if -3.2999999999999998e-57 < y < 3.10000000000000013e-102Initial program 90.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma -0.3333333333333333 (/ y z) x)))
(if (<= y -3.3e-57)
t_1
(if (<= y 3.1e-102) (* (/ t (* z y)) 0.3333333333333333) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-0.3333333333333333, (y / z), x);
double tmp;
if (y <= -3.3e-57) {
tmp = t_1;
} else if (y <= 3.1e-102) {
tmp = (t / (z * y)) * 0.3333333333333333;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(-0.3333333333333333, Float64(y / z), x) tmp = 0.0 if (y <= -3.3e-57) tmp = t_1; elseif (y <= 3.1e-102) tmp = Float64(Float64(t / Float64(z * y)) * 0.3333333333333333); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -3.3e-57], t$95$1, If[LessEqual[y, 3.1e-102], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-102}:\\
\;\;\;\;\frac{t}{z \cdot y} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2999999999999998e-57 or 3.10000000000000013e-102 < y Initial program 98.3%
Taylor expanded in t around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6483.2
Applied rewrites83.2%
if -3.2999999999999998e-57 < y < 3.10000000000000013e-102Initial program 90.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
(FPCore (x y z t) :precision binary64 (fma -0.3333333333333333 (/ y z) x))
double code(double x, double y, double z, double t) {
return fma(-0.3333333333333333, (y / z), x);
}
function code(x, y, z, t) return fma(-0.3333333333333333, Float64(y / z), x) end
code[x_, y_, z_, t_] := N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)
\end{array}
Initial program 95.4%
Taylor expanded in t around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
(FPCore (x y z t) :precision binary64 (if (<= x -2.4e-31) x (if (<= x 1.2e+33) (/ (* -0.3333333333333333 y) z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-31) {
tmp = x;
} else if (x <= 1.2e+33) {
tmp = (-0.3333333333333333 * y) / z;
} 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 (x <= (-2.4d-31)) then
tmp = x
else if (x <= 1.2d+33) then
tmp = ((-0.3333333333333333d0) * y) / z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-31) {
tmp = x;
} else if (x <= 1.2e+33) {
tmp = (-0.3333333333333333 * y) / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.4e-31: tmp = x elif x <= 1.2e+33: tmp = (-0.3333333333333333 * y) / z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.4e-31) tmp = x; elseif (x <= 1.2e+33) tmp = Float64(Float64(-0.3333333333333333 * y) / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.4e-31) tmp = x; elseif (x <= 1.2e+33) tmp = (-0.3333333333333333 * y) / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.4e-31], x, If[LessEqual[x, 1.2e+33], N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+33}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4e-31 or 1.2e33 < x Initial program 95.5%
Taylor expanded in x around inf
Applied rewrites50.2%
if -2.4e-31 < x < 1.2e33Initial program 95.3%
Taylor expanded in x around 0
associate-/r*N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
lower-/.f64N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6485.6
Applied rewrites85.6%
Taylor expanded in y around inf
lower-*.f6446.3
Applied rewrites46.3%
(FPCore (x y z t) :precision binary64 (if (<= x -2.4e-31) x (if (<= x 1.2e+33) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-31) {
tmp = x;
} else if (x <= 1.2e+33) {
tmp = -0.3333333333333333 * (y / z);
} 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 (x <= (-2.4d-31)) then
tmp = x
else if (x <= 1.2d+33) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-31) {
tmp = x;
} else if (x <= 1.2e+33) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.4e-31: tmp = x elif x <= 1.2e+33: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.4e-31) tmp = x; elseif (x <= 1.2e+33) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.4e-31) tmp = x; elseif (x <= 1.2e+33) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.4e-31], x, If[LessEqual[x, 1.2e+33], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+33}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4e-31 or 1.2e33 < x Initial program 95.5%
Taylor expanded in x around inf
Applied rewrites50.2%
if -2.4e-31 < x < 1.2e33Initial program 95.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6446.2
Applied rewrites46.2%
(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 95.4%
Taylor expanded in x around inf
Applied rewrites30.3%
herbie shell --seed 2025115
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))