
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
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)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
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)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- t z) a) y x))) (if (<= a -8.5e+164) t_1 (if (<= a 5e-44) (- x (/ (* y (- z t)) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / a), y, x);
double tmp;
if (a <= -8.5e+164) {
tmp = t_1;
} else if (a <= 5e-44) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / a), y, x) tmp = 0.0 if (a <= -8.5e+164) tmp = t_1; elseif (a <= 5e-44) tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -8.5e+164], t$95$1, If[LessEqual[a, 5e-44], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\
\mathbf{if}\;a \leq -8.5 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-44}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.50000000000000027e164 or 5.00000000000000039e-44 < a Initial program 93.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6493.9
Applied rewrites93.9%
if -8.50000000000000027e164 < a < 5.00000000000000039e-44Initial program 93.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- t z) a) y x))) (if (<= a -1.6e-141) t_1 (if (<= a 5.5e-229) (/ (* y (- t z)) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / a), y, x);
double tmp;
if (a <= -1.6e-141) {
tmp = t_1;
} else if (a <= 5.5e-229) {
tmp = (y * (t - z)) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / a), y, x) tmp = 0.0 if (a <= -1.6e-141) tmp = t_1; elseif (a <= 5.5e-229) tmp = Float64(Float64(y * Float64(t - z)) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -1.6e-141], t$95$1, If[LessEqual[a, 5.5e-229], N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-229}:\\
\;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.6000000000000001e-141 or 5.5000000000000001e-229 < a Initial program 93.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6493.9
Applied rewrites93.9%
if -1.6000000000000001e-141 < a < 5.5000000000000001e-229Initial program 93.1%
Taylor expanded in y around inf
sub-divN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6456.8
Applied rewrites56.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- t z) a) y))
(t_2 (/ (* y (- t z)) a))
(t_3 (/ (* y (- z t)) a)))
(if (<= t_3 (- INFINITY))
t_1
(if (<= t_3 -2e+28)
t_2
(if (<= t_3 5e+90) (fma (/ y a) t x) (if (<= t_3 5e+297) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - z) / a) * y;
double t_2 = (y * (t - z)) / a;
double t_3 = (y * (z - t)) / a;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_3 <= -2e+28) {
tmp = t_2;
} else if (t_3 <= 5e+90) {
tmp = fma((y / a), t, x);
} else if (t_3 <= 5e+297) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - z) / a) * y) t_2 = Float64(Float64(y * Float64(t - z)) / a) t_3 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_1; elseif (t_3 <= -2e+28) tmp = t_2; elseif (t_3 <= 5e+90) tmp = fma(Float64(y / a), t, x); elseif (t_3 <= 5e+297) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -2e+28], t$95$2, If[LessEqual[t$95$3, 5e+90], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[t$95$3, 5e+297], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a} \cdot y\\
t_2 := \frac{y \cdot \left(t - z\right)}{a}\\
t_3 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+28}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0 or 4.9999999999999998e297 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 93.1%
Taylor expanded in y around inf
sub-divN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6456.8
Applied rewrites56.8%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6457.2
Applied rewrites57.2%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < -1.99999999999999992e28 or 5.0000000000000004e90 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.9999999999999998e297Initial program 93.1%
Taylor expanded in y around inf
sub-divN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6456.8
Applied rewrites56.8%
if -1.99999999999999992e28 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000004e90Initial program 93.1%
Taylor expanded in z around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
associate-/l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.2e-18) (- x (/ (* z y) a)) (if (<= z 8.5e+121) (fma (/ y a) t x) (- x (* (/ z a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-18) {
tmp = x - ((z * y) / a);
} else if (z <= 8.5e+121) {
tmp = fma((y / a), t, x);
} else {
tmp = x - ((z / a) * y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e-18) tmp = Float64(x - Float64(Float64(z * y) / a)); elseif (z <= 8.5e+121) tmp = fma(Float64(y / a), t, x); else tmp = Float64(x - Float64(Float64(z / a) * y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e-18], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+121], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], N[(x - N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-18}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{a} \cdot y\\
\end{array}
\end{array}
if z < -4.19999999999999999e-18Initial program 93.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f6468.2
Applied rewrites68.2%
if -4.19999999999999999e-18 < z < 8.5e121Initial program 93.1%
Taylor expanded in z around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
associate-/l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
if 8.5e121 < z Initial program 93.1%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6468.4
Applied rewrites68.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* (/ z a) y)))) (if (<= z -4.2e-18) t_1 (if (<= z 8.5e+121) (fma (/ y a) t x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((z / a) * y);
double tmp;
if (z <= -4.2e-18) {
tmp = t_1;
} else if (z <= 8.5e+121) {
tmp = fma((y / a), t, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(z / a) * y)) tmp = 0.0 if (z <= -4.2e-18) tmp = t_1; elseif (z <= 8.5e+121) tmp = fma(Float64(y / a), t, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-18], t$95$1, If[LessEqual[z, 8.5e+121], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{z}{a} \cdot y\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.19999999999999999e-18 or 8.5e121 < z Initial program 93.1%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6468.4
Applied rewrites68.4%
if -4.19999999999999999e-18 < z < 8.5e121Initial program 93.1%
Taylor expanded in z around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
associate-/l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (- z t))) (t_2 (* (/ (- t z) a) y))) (if (<= t_1 -5e+71) t_2 (if (<= t_1 1e+209) (fma (/ y a) t x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = ((t - z) / a) * y;
double tmp;
if (t_1 <= -5e+71) {
tmp = t_2;
} else if (t_1 <= 1e+209) {
tmp = fma((y / a), t, x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) t_2 = Float64(Float64(Float64(t - z) / a) * y) tmp = 0.0 if (t_1 <= -5e+71) tmp = t_2; elseif (t_1 <= 1e+209) tmp = fma(Float64(y / a), t, x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+71], t$95$2, If[LessEqual[t$95$1, 1e+209], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
t_2 := \frac{t - z}{a} \cdot y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+71}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+209}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -4.99999999999999972e71 or 1.0000000000000001e209 < (*.f64 y (-.f64 z t)) Initial program 93.1%
Taylor expanded in y around inf
sub-divN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6456.8
Applied rewrites56.8%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6457.2
Applied rewrites57.2%
if -4.99999999999999972e71 < (*.f64 y (-.f64 z t)) < 1.0000000000000001e209Initial program 93.1%
Taylor expanded in z around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
associate-/l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.6e+170) (* (- y) (/ z a)) (if (<= z 1.9e+187) (fma (/ y a) t x) (* (- z) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.6e+170) {
tmp = -y * (z / a);
} else if (z <= 1.9e+187) {
tmp = fma((y / a), t, x);
} else {
tmp = -z * (y / a);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.6e+170) tmp = Float64(Float64(-y) * Float64(z / a)); elseif (z <= 1.9e+187) tmp = fma(Float64(y / a), t, x); else tmp = Float64(Float64(-z) * Float64(y / a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.6e+170], N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+187], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], N[((-z) * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+170}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+187}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7.5999999999999996e170Initial program 93.1%
Taylor expanded in x around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6457.2
Applied rewrites57.2%
Taylor expanded in z around inf
lower-/.f6431.9
Applied rewrites31.9%
if -7.5999999999999996e170 < z < 1.9e187Initial program 93.1%
Taylor expanded in z around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
associate-/l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
if 1.9e187 < z Initial program 93.1%
Taylor expanded in z around inf
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6434.5
Applied rewrites34.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) a)))
(if (<= t_1 -2e+28)
(* (- z) (/ y a))
(if (<= t_1 4e+47)
(* 1.0 x)
(if (<= t_1 5e+266) (/ (* y t) a) (* (- y) (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -2e+28) {
tmp = -z * (y / a);
} else if (t_1 <= 4e+47) {
tmp = 1.0 * x;
} else if (t_1 <= 5e+266) {
tmp = (y * t) / a;
} else {
tmp = -y * (z / a);
}
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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / a
if (t_1 <= (-2d+28)) then
tmp = -z * (y / a)
else if (t_1 <= 4d+47) then
tmp = 1.0d0 * x
else if (t_1 <= 5d+266) then
tmp = (y * t) / a
else
tmp = -y * (z / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -2e+28) {
tmp = -z * (y / a);
} else if (t_1 <= 4e+47) {
tmp = 1.0 * x;
} else if (t_1 <= 5e+266) {
tmp = (y * t) / a;
} else {
tmp = -y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -2e+28: tmp = -z * (y / a) elif t_1 <= 4e+47: tmp = 1.0 * x elif t_1 <= 5e+266: tmp = (y * t) / a else: tmp = -y * (z / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -2e+28) tmp = Float64(Float64(-z) * Float64(y / a)); elseif (t_1 <= 4e+47) tmp = Float64(1.0 * x); elseif (t_1 <= 5e+266) tmp = Float64(Float64(y * t) / a); else tmp = Float64(Float64(-y) * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -2e+28) tmp = -z * (y / a); elseif (t_1 <= 4e+47) tmp = 1.0 * x; elseif (t_1 <= 5e+266) tmp = (y * t) / a; else tmp = -y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+28], N[((-z) * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+47], N[(1.0 * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+266], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+28}:\\
\;\;\;\;\left(-z\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+47}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+266}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -1.99999999999999992e28Initial program 93.1%
Taylor expanded in z around inf
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6434.5
Applied rewrites34.5%
if -1.99999999999999992e28 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.0000000000000002e47Initial program 93.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-*.f6486.5
Applied rewrites86.5%
Taylor expanded in x around inf
Applied rewrites39.5%
if 4.0000000000000002e47 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.9999999999999999e266Initial program 93.1%
Taylor expanded in y around inf
sub-divN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6456.8
Applied rewrites56.8%
Taylor expanded in z around 0
Applied rewrites31.8%
if 4.9999999999999999e266 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 93.1%
Taylor expanded in x around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6457.2
Applied rewrites57.2%
Taylor expanded in z around inf
lower-/.f6431.9
Applied rewrites31.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (- y) (/ z a))))
(if (<= t_1 -2e+28)
t_2
(if (<= t_1 4e+47) (* 1.0 x) (if (<= t_1 5e+266) (/ (* y t) a) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = -y * (z / a);
double tmp;
if (t_1 <= -2e+28) {
tmp = t_2;
} else if (t_1 <= 4e+47) {
tmp = 1.0 * x;
} else if (t_1 <= 5e+266) {
tmp = (y * t) / a;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * (z - t)) / a
t_2 = -y * (z / a)
if (t_1 <= (-2d+28)) then
tmp = t_2
else if (t_1 <= 4d+47) then
tmp = 1.0d0 * x
else if (t_1 <= 5d+266) then
tmp = (y * t) / a
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = -y * (z / a);
double tmp;
if (t_1 <= -2e+28) {
tmp = t_2;
} else if (t_1 <= 4e+47) {
tmp = 1.0 * x;
} else if (t_1 <= 5e+266) {
tmp = (y * t) / a;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = -y * (z / a) tmp = 0 if t_1 <= -2e+28: tmp = t_2 elif t_1 <= 4e+47: tmp = 1.0 * x elif t_1 <= 5e+266: tmp = (y * t) / a else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(Float64(-y) * Float64(z / a)) tmp = 0.0 if (t_1 <= -2e+28) tmp = t_2; elseif (t_1 <= 4e+47) tmp = Float64(1.0 * x); elseif (t_1 <= 5e+266) tmp = Float64(Float64(y * t) / a); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = -y * (z / a); tmp = 0.0; if (t_1 <= -2e+28) tmp = t_2; elseif (t_1 <= 4e+47) tmp = 1.0 * x; elseif (t_1 <= 5e+266) tmp = (y * t) / a; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+28], t$95$2, If[LessEqual[t$95$1, 4e+47], N[(1.0 * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+266], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \left(-y\right) \cdot \frac{z}{a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+28}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+47}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+266}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -1.99999999999999992e28 or 4.9999999999999999e266 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 93.1%
Taylor expanded in x around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6457.2
Applied rewrites57.2%
Taylor expanded in z around inf
lower-/.f6431.9
Applied rewrites31.9%
if -1.99999999999999992e28 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.0000000000000002e47Initial program 93.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-*.f6486.5
Applied rewrites86.5%
Taylor expanded in x around inf
Applied rewrites39.5%
if 4.0000000000000002e47 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.9999999999999999e266Initial program 93.1%
Taylor expanded in y around inf
sub-divN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6456.8
Applied rewrites56.8%
Taylor expanded in z around 0
Applied rewrites31.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* t (/ y a)))) (if (<= t_1 -2e+47) t_2 (if (<= t_1 4e+47) (* 1.0 x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = t * (y / a);
double tmp;
if (t_1 <= -2e+47) {
tmp = t_2;
} else if (t_1 <= 4e+47) {
tmp = 1.0 * x;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * (z - t)) / a
t_2 = t * (y / a)
if (t_1 <= (-2d+47)) then
tmp = t_2
else if (t_1 <= 4d+47) then
tmp = 1.0d0 * x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = t * (y / a);
double tmp;
if (t_1 <= -2e+47) {
tmp = t_2;
} else if (t_1 <= 4e+47) {
tmp = 1.0 * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = t * (y / a) tmp = 0 if t_1 <= -2e+47: tmp = t_2 elif t_1 <= 4e+47: tmp = 1.0 * x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(t * Float64(y / a)) tmp = 0.0 if (t_1 <= -2e+47) tmp = t_2; elseif (t_1 <= 4e+47) tmp = Float64(1.0 * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = t * (y / a); tmp = 0.0; if (t_1 <= -2e+47) tmp = t_2; elseif (t_1 <= 4e+47) tmp = 1.0 * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+47], t$95$2, If[LessEqual[t$95$1, 4e+47], N[(1.0 * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := t \cdot \frac{y}{a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+47}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -2.0000000000000001e47 or 4.0000000000000002e47 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 93.1%
Taylor expanded in t around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.0
Applied rewrites32.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6434.3
Applied rewrites34.3%
if -2.0000000000000001e47 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.0000000000000002e47Initial program 93.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-*.f6486.5
Applied rewrites86.5%
Taylor expanded in x around inf
Applied rewrites39.5%
(FPCore (x y z t a) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a) {
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, 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a) {
return 1.0 * x;
}
def code(x, y, z, t, a): return 1.0 * x
function code(x, y, z, t, a) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 93.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower-*.f6486.5
Applied rewrites86.5%
Taylor expanded in x around inf
Applied rewrites39.5%
herbie shell --seed 2025139
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
(- x (/ (* y (- z t)) a)))