
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (- a z)) t x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (a - z)), t, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(a - z)), t, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)
\end{array}
Initial program 85.7%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6498.2
Applied rewrites98.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (- 1.0 (/ y z)) x))) (if (<= z -9e+34) t_1 (if (<= z 42000000.0) (fma (/ y (- a z)) t x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (1.0 - (y / z)), x);
double tmp;
if (z <= -9e+34) {
tmp = t_1;
} else if (z <= 42000000.0) {
tmp = fma((y / (a - z)), t, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(1.0 - Float64(y / z)), x) tmp = 0.0 if (z <= -9e+34) tmp = t_1; elseif (z <= 42000000.0) tmp = fma(Float64(y / Float64(a - z)), t, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -9e+34], t$95$1, If[LessEqual[z, 42000000.0], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, 1 - \frac{y}{z}, x\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 42000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.0000000000000001e34 or 4.2e7 < z Initial program 74.4%
Taylor expanded in a around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6465.9
Applied rewrites65.9%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6487.0
Applied rewrites87.0%
if -9.0000000000000001e34 < z < 4.2e7Initial program 95.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6496.7
Applied rewrites96.7%
Taylor expanded in y around inf
Applied rewrites87.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (- 1.0 (/ y z)) x))) (if (<= z -3e+33) t_1 (if (<= z 3.7e-24) (fma t (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (1.0 - (y / z)), x);
double tmp;
if (z <= -3e+33) {
tmp = t_1;
} else if (z <= 3.7e-24) {
tmp = fma(t, ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(1.0 - Float64(y / z)), x) tmp = 0.0 if (z <= -3e+33) tmp = t_1; elseif (z <= 3.7e-24) tmp = fma(t, Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -3e+33], t$95$1, If[LessEqual[z, 3.7e-24], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, 1 - \frac{y}{z}, x\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-24}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.99999999999999984e33 or 3.69999999999999981e-24 < z Initial program 75.5%
Taylor expanded in a around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.2
Applied rewrites66.2%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6486.3
Applied rewrites86.3%
if -2.99999999999999984e33 < z < 3.69999999999999981e-24Initial program 95.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6480.6
Applied rewrites80.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (- 1.0 (/ y z)) x))) (if (<= z -2.45e+33) t_1 (if (<= z 3.7e-24) (fma t (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (1.0 - (y / z)), x);
double tmp;
if (z <= -2.45e+33) {
tmp = t_1;
} else if (z <= 3.7e-24) {
tmp = fma(t, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(1.0 - Float64(y / z)), x) tmp = 0.0 if (z <= -2.45e+33) tmp = t_1; elseif (z <= 3.7e-24) tmp = fma(t, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -2.45e+33], t$95$1, If[LessEqual[z, 3.7e-24], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, 1 - \frac{y}{z}, x\right)\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-24}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.45000000000000007e33 or 3.69999999999999981e-24 < z Initial program 75.5%
Taylor expanded in a around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.2
Applied rewrites66.2%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6486.3
Applied rewrites86.3%
if -2.45000000000000007e33 < z < 3.69999999999999981e-24Initial program 95.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.6
Applied rewrites77.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+34)
(+ x t)
(if (<= z 1.2e-78)
(fma t (/ y a) x)
(if (<= z 2.3e+94) (- x (/ (* y t) z)) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+34) {
tmp = x + t;
} else if (z <= 1.2e-78) {
tmp = fma(t, (y / a), x);
} else if (z <= 2.3e+94) {
tmp = x - ((y * t) / z);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+34) tmp = Float64(x + t); elseif (z <= 1.2e-78) tmp = fma(t, Float64(y / a), x); elseif (z <= 2.3e+94) tmp = Float64(x - Float64(Float64(y * t) / z)); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+34], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.2e-78], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.3e+94], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+94}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.5000000000000003e34 or 2.3e94 < z Initial program 71.9%
Taylor expanded in z around inf
Applied rewrites80.7%
if -8.5000000000000003e34 < z < 1.2e-78Initial program 95.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6478.7
Applied rewrites78.7%
if 1.2e-78 < z < 2.3e94Initial program 92.1%
Taylor expanded in a around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6467.2
Applied rewrites67.2%
Taylor expanded in y around inf
Applied rewrites59.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+34)
(+ x t)
(if (<= z 8.6e-24)
(fma t (/ y a) x)
(if (<= z 1500000000.0) (* y (/ t (- a z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+34) {
tmp = x + t;
} else if (z <= 8.6e-24) {
tmp = fma(t, (y / a), x);
} else if (z <= 1500000000.0) {
tmp = y * (t / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+34) tmp = Float64(x + t); elseif (z <= 8.6e-24) tmp = fma(t, Float64(y / a), x); elseif (z <= 1500000000.0) tmp = Float64(y * Float64(t / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+34], N[(x + t), $MachinePrecision], If[LessEqual[z, 8.6e-24], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1500000000.0], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-24}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 1500000000:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.5000000000000003e34 or 1.5e9 < z Initial program 74.4%
Taylor expanded in z around inf
Applied rewrites77.6%
if -8.5000000000000003e34 < z < 8.6000000000000006e-24Initial program 95.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.5
Applied rewrites77.5%
if 8.6000000000000006e-24 < z < 1.5e9Initial program 96.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6449.4
Applied rewrites49.4%
Taylor expanded in y around inf
Applied rewrites29.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+34)
(+ x t)
(if (<= z 4.5e-31)
(fma t (/ y a) x)
(if (<= z 1500000000.0) (* t (/ y (- a z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+34) {
tmp = x + t;
} else if (z <= 4.5e-31) {
tmp = fma(t, (y / a), x);
} else if (z <= 1500000000.0) {
tmp = t * (y / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+34) tmp = Float64(x + t); elseif (z <= 4.5e-31) tmp = fma(t, Float64(y / a), x); elseif (z <= 1500000000.0) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+34], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.5e-31], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1500000000.0], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 1500000000:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.5000000000000003e34 or 1.5e9 < z Initial program 74.4%
Taylor expanded in z around inf
Applied rewrites77.6%
if -8.5000000000000003e34 < z < 4.5000000000000004e-31Initial program 95.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.7
Applied rewrites77.7%
if 4.5000000000000004e-31 < z < 1.5e9Initial program 96.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6431.4
Applied rewrites31.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+34)
(+ x t)
(if (<= z 8.6e-24)
(fma t (/ y a) x)
(if (<= z 9.5e+15) (* t (- 1.0 (/ y z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+34) {
tmp = x + t;
} else if (z <= 8.6e-24) {
tmp = fma(t, (y / a), x);
} else if (z <= 9.5e+15) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+34) tmp = Float64(x + t); elseif (z <= 8.6e-24) tmp = fma(t, Float64(y / a), x); elseif (z <= 9.5e+15) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+34], N[(x + t), $MachinePrecision], If[LessEqual[z, 8.6e-24], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 9.5e+15], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-24}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+15}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.5000000000000003e34 or 9.5e15 < z Initial program 74.2%
Taylor expanded in z around inf
Applied rewrites77.9%
if -8.5000000000000003e34 < z < 8.6000000000000006e-24Initial program 95.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.5
Applied rewrites77.5%
if 8.6000000000000006e-24 < z < 9.5e15Initial program 95.7%
Taylor expanded in a around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.9
Applied rewrites69.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6431.0
Applied rewrites31.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+34)
(+ x t)
(if (<= z 4.5e-31)
(fma t (/ y a) x)
(if (<= z 800000000.0) (* t (/ y (- z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+34) {
tmp = x + t;
} else if (z <= 4.5e-31) {
tmp = fma(t, (y / a), x);
} else if (z <= 800000000.0) {
tmp = t * (y / -z);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+34) tmp = Float64(x + t); elseif (z <= 4.5e-31) tmp = fma(t, Float64(y / a), x); elseif (z <= 800000000.0) tmp = Float64(t * Float64(y / Float64(-z))); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+34], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.5e-31], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 800000000.0], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 800000000:\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.5000000000000003e34 or 8e8 < z Initial program 74.4%
Taylor expanded in z around inf
Applied rewrites77.6%
if -8.5000000000000003e34 < z < 4.5000000000000004e-31Initial program 95.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.7
Applied rewrites77.7%
if 4.5000000000000004e-31 < z < 8e8Initial program 96.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6431.4
Applied rewrites31.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6421.2
Applied rewrites21.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -105000000.0) (+ x t) (if (<= z 4.5e-31) x (if (<= z 800000000.0) (* t (/ y (- z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -105000000.0) {
tmp = x + t;
} else if (z <= 4.5e-31) {
tmp = x;
} else if (z <= 800000000.0) {
tmp = t * (y / -z);
} else {
tmp = 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-105000000.0d0)) then
tmp = x + t
else if (z <= 4.5d-31) then
tmp = x
else if (z <= 800000000.0d0) then
tmp = t * (y / -z)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -105000000.0) {
tmp = x + t;
} else if (z <= 4.5e-31) {
tmp = x;
} else if (z <= 800000000.0) {
tmp = t * (y / -z);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -105000000.0: tmp = x + t elif z <= 4.5e-31: tmp = x elif z <= 800000000.0: tmp = t * (y / -z) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -105000000.0) tmp = Float64(x + t); elseif (z <= 4.5e-31) tmp = x; elseif (z <= 800000000.0) tmp = Float64(t * Float64(y / Float64(-z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -105000000.0) tmp = x + t; elseif (z <= 4.5e-31) tmp = x; elseif (z <= 800000000.0) tmp = t * (y / -z); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -105000000.0], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.5e-31], x, If[LessEqual[z, 800000000.0], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -105000000:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 800000000:\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.05e8 or 8e8 < z Initial program 75.2%
Taylor expanded in z around inf
Applied rewrites76.8%
if -1.05e8 < z < 4.5000000000000004e-31Initial program 95.7%
Taylor expanded in x around inf
Applied rewrites49.3%
if 4.5000000000000004e-31 < z < 8e8Initial program 96.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6431.4
Applied rewrites31.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6421.2
Applied rewrites21.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -105000000.0) (+ x t) (if (<= z 4.5e-31) x (if (<= z 800000000.0) (/ (* (- t) y) z) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -105000000.0) {
tmp = x + t;
} else if (z <= 4.5e-31) {
tmp = x;
} else if (z <= 800000000.0) {
tmp = (-t * y) / z;
} else {
tmp = 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-105000000.0d0)) then
tmp = x + t
else if (z <= 4.5d-31) then
tmp = x
else if (z <= 800000000.0d0) then
tmp = (-t * y) / z
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -105000000.0) {
tmp = x + t;
} else if (z <= 4.5e-31) {
tmp = x;
} else if (z <= 800000000.0) {
tmp = (-t * y) / z;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -105000000.0: tmp = x + t elif z <= 4.5e-31: tmp = x elif z <= 800000000.0: tmp = (-t * y) / z else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -105000000.0) tmp = Float64(x + t); elseif (z <= 4.5e-31) tmp = x; elseif (z <= 800000000.0) tmp = Float64(Float64(Float64(-t) * y) / z); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -105000000.0) tmp = x + t; elseif (z <= 4.5e-31) tmp = x; elseif (z <= 800000000.0) tmp = (-t * y) / z; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -105000000.0], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.5e-31], x, If[LessEqual[z, 800000000.0], N[(N[((-t) * y), $MachinePrecision] / z), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -105000000:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 800000000:\\
\;\;\;\;\frac{\left(-t\right) \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.05e8 or 8e8 < z Initial program 75.2%
Taylor expanded in z around inf
Applied rewrites76.8%
if -1.05e8 < z < 4.5000000000000004e-31Initial program 95.7%
Taylor expanded in x around inf
Applied rewrites49.3%
if 4.5000000000000004e-31 < z < 8e8Initial program 96.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6431.4
Applied rewrites31.4%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6421.3
Applied rewrites21.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -105000000.0) (+ x t) (if (<= z 112000000.0) x (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -105000000.0) {
tmp = x + t;
} else if (z <= 112000000.0) {
tmp = x;
} else {
tmp = 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-105000000.0d0)) then
tmp = x + t
else if (z <= 112000000.0d0) then
tmp = x
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -105000000.0) {
tmp = x + t;
} else if (z <= 112000000.0) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -105000000.0: tmp = x + t elif z <= 112000000.0: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -105000000.0) tmp = Float64(x + t); elseif (z <= 112000000.0) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -105000000.0) tmp = x + t; elseif (z <= 112000000.0) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -105000000.0], N[(x + t), $MachinePrecision], If[LessEqual[z, 112000000.0], x, N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -105000000:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 112000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.05e8 or 1.12e8 < z Initial program 75.2%
Taylor expanded in z around inf
Applied rewrites76.8%
if -1.05e8 < z < 1.12e8Initial program 95.7%
Taylor expanded in x around inf
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* (- y z) t) (- a z)))) (if (<= t_1 (- INFINITY)) t (if (<= t_1 1e+168) x t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t;
} else if (t_1 <= 1e+168) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t;
} else if (t_1 <= 1e+168) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = t elif t_1 <= 1e+168: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t; elseif (t_1 <= 1e+168) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = t; elseif (t_1 <= 1e+168) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t, If[LessEqual[t$95$1, 1e+168], x, t]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\\
\mathbf{elif}\;t\_1 \leq 10^{+168}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 9.9999999999999993e167 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 48.9%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6485.4
Applied rewrites85.4%
Taylor expanded in z around inf
Applied rewrites29.3%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 9.9999999999999993e167Initial program 99.7%
Taylor expanded in x around inf
Applied rewrites63.6%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.7%
Taylor expanded in x around inf
Applied rewrites49.9%
herbie shell --seed 2025120
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
(+ x (/ (* (- y z) t) (- a z))))