
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -10.0)
(+ x (* y (/ (- t) (- z a))))
(if (<= t_1 1e-15)
(fma (/ (- t z) a) y x)
(if (<= t_1 2.0)
(fma (/ (- z t) z) y x)
(+ x (/ (* (- t) y) (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -10.0) {
tmp = x + (y * (-t / (z - a)));
} else if (t_1 <= 1e-15) {
tmp = fma(((t - z) / a), y, x);
} else if (t_1 <= 2.0) {
tmp = fma(((z - t) / z), y, x);
} else {
tmp = x + ((-t * y) / (z - a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -10.0) tmp = Float64(x + Float64(y * Float64(Float64(-t) / Float64(z - a)))); elseif (t_1 <= 1e-15) tmp = fma(Float64(Float64(t - z) / a), y, x); elseif (t_1 <= 2.0) tmp = fma(Float64(Float64(z - t) / z), y, x); else tmp = Float64(x + Float64(Float64(Float64(-t) * y) / Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10.0], N[(x + N[(y * N[((-t) / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-15], N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision] * y + x), $MachinePrecision], N[(x + N[(N[((-t) * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -10:\\
\;\;\;\;x + y \cdot \frac{-t}{z - a}\\
\mathbf{elif}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(-t\right) \cdot y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -10Initial program 96.3%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15Initial program 99.3%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6491.1
Applied rewrites91.1%
Applied rewrites99.0%
if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6496.8
Applied rewrites96.8%
if 2 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.3%
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6490.5
Applied rewrites90.5%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6490.0
Applied rewrites90.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (+ x (* y (/ (- t) (- z a))))))
(if (<= t_1 -10.0)
t_2
(if (<= t_1 1e-15)
(fma (/ (- t z) a) y x)
(if (<= t_1 2.0) (fma (/ (- z t) z) y x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x + (y * (-t / (z - a)));
double tmp;
if (t_1 <= -10.0) {
tmp = t_2;
} else if (t_1 <= 1e-15) {
tmp = fma(((t - z) / a), y, x);
} else if (t_1 <= 2.0) {
tmp = fma(((z - t) / z), y, x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(x + Float64(y * Float64(Float64(-t) / Float64(z - a)))) tmp = 0.0 if (t_1 <= -10.0) tmp = t_2; elseif (t_1 <= 1e-15) tmp = fma(Float64(Float64(t - z) / a), y, x); elseif (t_1 <= 2.0) tmp = fma(Float64(Float64(z - t) / z), y, x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[((-t) / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10.0], t$95$2, If[LessEqual[t$95$1, 1e-15], N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision] * y + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + y \cdot \frac{-t}{z - a}\\
\mathbf{if}\;t\_1 \leq -10:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -10 or 2 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.8%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6494.9
Applied rewrites94.9%
if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15Initial program 99.3%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6491.1
Applied rewrites91.1%
Applied rewrites99.0%
if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6496.8
Applied rewrites96.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 1e-15)
(fma (/ (- t z) a) y x)
(if (<= t_1 1e+63) (fma (/ (- z t) z) y x) (* (- t) (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e-15) {
tmp = fma(((t - z) / a), y, x);
} else if (t_1 <= 1e+63) {
tmp = fma(((z - t) / z), y, x);
} else {
tmp = -t * (y / (z - a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e-15) tmp = fma(Float64(Float64(t - z) / a), y, x); elseif (t_1 <= 1e+63) tmp = fma(Float64(Float64(z - t) / z), y, x); else tmp = Float64(Float64(-t) * Float64(y / Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-15], N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision] * y + x), $MachinePrecision], N[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15Initial program 98.3%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6480.4
Applied rewrites80.4%
Applied rewrites86.0%
if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6493.3
Applied rewrites93.3%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in t around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6473.7
Applied rewrites73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 1e-15)
(fma (/ (- t z) a) y x)
(if (<= t_1 1e+63) (fma (/ z (- z a)) y x) (* (- t) (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e-15) {
tmp = fma(((t - z) / a), y, x);
} else if (t_1 <= 1e+63) {
tmp = fma((z / (z - a)), y, x);
} else {
tmp = -t * (y / (z - a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e-15) tmp = fma(Float64(Float64(t - z) / a), y, x); elseif (t_1 <= 1e+63) tmp = fma(Float64(z / Float64(z - a)), y, x); else tmp = Float64(Float64(-t) * Float64(y / Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-15], N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15Initial program 98.3%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6480.4
Applied rewrites80.4%
Applied rewrites86.0%
if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6492.6
Applied rewrites92.6%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in t around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6473.7
Applied rewrites73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 2e-219)
(+ x (* y (/ t a)))
(if (<= t_1 1e+63) (fma (/ z (- z a)) y x) (* (- t) (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 2e-219) {
tmp = x + (y * (t / a));
} else if (t_1 <= 1e+63) {
tmp = fma((z / (z - a)), y, x);
} else {
tmp = -t * (y / (z - a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 2e-219) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 1e+63) tmp = fma(Float64(z / Float64(z - a)), y, x); else tmp = Float64(Float64(-t) * Float64(y / Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-219], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6475.1
Applied rewrites75.1%
if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6490.2
Applied rewrites90.2%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in t around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6473.7
Applied rewrites73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (/ y (- z a))))
(if (<= t_1 2e-219)
(+ x (* y (/ t a)))
(if (<= t_1 0.9995)
(fma z t_2 x)
(if (<= t_1 1e+63) (+ x y) (* (- t) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = y / (z - a);
double tmp;
if (t_1 <= 2e-219) {
tmp = x + (y * (t / a));
} else if (t_1 <= 0.9995) {
tmp = fma(z, t_2, x);
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = -t * t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(y / Float64(z - a)) tmp = 0.0 if (t_1 <= 2e-219) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 0.9995) tmp = fma(z, t_2, x); elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = Float64(Float64(-t) * t_2); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-219], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.9995], N[(z * t$95$2 + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], N[((-t) * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{z - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 0.9995:\\
\;\;\;\;\mathsf{fma}\left(z, t\_2, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6475.1
Applied rewrites75.1%
if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.99950000000000006Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6480.8
Applied rewrites80.8%
lift--.f64N/A
lift-/.f64N/A
lower-fma.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6479.3
Applied rewrites79.3%
if 0.99950000000000006 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 100.0%
Taylor expanded in z around inf
Applied rewrites92.9%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in t around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6473.7
Applied rewrites73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 2e-219)
(+ x (* y (/ t a)))
(if (<= t_1 2e-28)
(- x (* (/ y a) z))
(if (<= t_1 1e+63) (+ x y) (* (- t) (/ y (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 2e-219) {
tmp = x + (y * (t / a));
} else if (t_1 <= 2e-28) {
tmp = x - ((y / a) * z);
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = -t * (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 = (z - t) / (z - a)
if (t_1 <= 2d-219) then
tmp = x + (y * (t / a))
else if (t_1 <= 2d-28) then
tmp = x - ((y / a) * z)
else if (t_1 <= 1d+63) then
tmp = x + y
else
tmp = -t * (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 = (z - t) / (z - a);
double tmp;
if (t_1 <= 2e-219) {
tmp = x + (y * (t / a));
} else if (t_1 <= 2e-28) {
tmp = x - ((y / a) * z);
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = -t * (y / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= 2e-219: tmp = x + (y * (t / a)) elif t_1 <= 2e-28: tmp = x - ((y / a) * z) elif t_1 <= 1e+63: tmp = x + y else: tmp = -t * (y / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 2e-219) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 2e-28) tmp = Float64(x - Float64(Float64(y / a) * z)); elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = Float64(Float64(-t) * Float64(y / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= 2e-219) tmp = x + (y * (t / a)); elseif (t_1 <= 2e-28) tmp = x - ((y / a) * z); elseif (t_1 <= 1e+63) tmp = x + y; else tmp = -t * (y / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-219], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-28], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], N[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-28}:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6475.1
Applied rewrites75.1%
if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999994e-28Initial program 99.9%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6488.9
Applied rewrites88.9%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
if 1.99999999999999994e-28 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in z around inf
Applied rewrites90.5%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in t around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6473.7
Applied rewrites73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 2e-219)
(+ x (* y (/ t a)))
(if (<= t_1 2e-28)
(- x (* (/ y a) z))
(if (<= t_1 1e+63) (+ x y) (fma (/ y a) t x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 2e-219) {
tmp = x + (y * (t / a));
} else if (t_1 <= 2e-28) {
tmp = x - ((y / a) * z);
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = fma((y / a), t, x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 2e-219) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 2e-28) tmp = Float64(x - Float64(Float64(y / a) * z)); elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = fma(Float64(y / a), t, x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-219], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-28], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-28}:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6475.1
Applied rewrites75.1%
if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999994e-28Initial program 99.9%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6488.9
Applied rewrites88.9%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
if 1.99999999999999994e-28 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in z around inf
Applied rewrites90.5%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 2e-219)
(fma (/ t a) y x)
(if (<= t_1 2e-28)
(- x (* (/ y a) z))
(if (<= t_1 1e+63) (+ x y) (fma (/ y a) t x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 2e-219) {
tmp = fma((t / a), y, x);
} else if (t_1 <= 2e-28) {
tmp = x - ((y / a) * z);
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = fma((y / a), t, x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 2e-219) tmp = fma(Float64(t / a), y, x); elseif (t_1 <= 2e-28) tmp = Float64(x - Float64(Float64(y / a) * z)); elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = fma(Float64(y / a), t, x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-219], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 2e-28], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-28}:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6475.1
Applied rewrites75.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.1
Applied rewrites75.1%
if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999994e-28Initial program 99.9%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6488.9
Applied rewrites88.9%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
if 1.99999999999999994e-28 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in z around inf
Applied rewrites90.5%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 1e-15)
(fma (/ t a) y x)
(if (<= t_1 1e+63) (+ x y) (fma (/ y a) t x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e-15) {
tmp = fma((t / a), y, x);
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = fma((y / a), t, x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e-15) tmp = fma(Float64(t / a), y, x); elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = fma(Float64(y / a), t, x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-15], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15Initial program 98.3%
Taylor expanded in z around 0
lower-/.f6476.8
Applied rewrites76.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.8
Applied rewrites76.8%
if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in z around inf
Applied rewrites91.3%
if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (fma (/ y a) t x))) (if (<= t_1 1e-15) t_2 (if (<= t_1 1e+63) (+ x y) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = fma((y / a), t, x);
double tmp;
if (t_1 <= 1e-15) {
tmp = t_2;
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = fma(Float64(y / a), t, x) tmp = 0.0 if (t_1 <= 1e-15) tmp = t_2; elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-15], t$95$2, If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{if}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15 or 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.4
Applied rewrites74.4%
if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in z around inf
Applied rewrites91.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* t (/ y a))))
(if (<= t_1 -1e+38)
t_2
(if (<= t_1 5e-124) x (if (<= t_1 1e+63) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = t * (y / a);
double tmp;
if (t_1 <= -1e+38) {
tmp = t_2;
} else if (t_1 <= 5e-124) {
tmp = x;
} else if (t_1 <= 1e+63) {
tmp = x + y;
} 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 = (z - t) / (z - a)
t_2 = t * (y / a)
if (t_1 <= (-1d+38)) then
tmp = t_2
else if (t_1 <= 5d-124) then
tmp = x
else if (t_1 <= 1d+63) then
tmp = x + y
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 = (z - t) / (z - a);
double t_2 = t * (y / a);
double tmp;
if (t_1 <= -1e+38) {
tmp = t_2;
} else if (t_1 <= 5e-124) {
tmp = x;
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = t * (y / a) tmp = 0 if t_1 <= -1e+38: tmp = t_2 elif t_1 <= 5e-124: tmp = x elif t_1 <= 1e+63: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(t * Float64(y / a)) tmp = 0.0 if (t_1 <= -1e+38) tmp = t_2; elseif (t_1 <= 5e-124) tmp = x; elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = t * (y / a); tmp = 0.0; if (t_1 <= -1e+38) tmp = t_2; elseif (t_1 <= 5e-124) tmp = x; elseif (t_1 <= 1e+63) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+38], t$95$2, If[LessEqual[t$95$1, 5e-124], x, If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := t \cdot \frac{y}{a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+38}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-124}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999977e37 or 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.6%
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6493.6
Applied rewrites93.6%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6493.6
Applied rewrites93.6%
Taylor expanded in t around inf
*-commutativeN/A
associate-/l*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift--.f6469.8
Applied rewrites69.8%
Taylor expanded in z around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f6446.5
Applied rewrites46.5%
if -9.99999999999999977e37 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000003e-124Initial program 99.3%
Taylor expanded in x around inf
Applied rewrites71.6%
if 5.0000000000000003e-124 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in z around inf
Applied rewrites85.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (/ (* y t) a)))
(if (<= t_1 -1e+38)
t_2
(if (<= t_1 5e-124) x (if (<= t_1 1e+63) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y * t) / a;
double tmp;
if (t_1 <= -1e+38) {
tmp = t_2;
} else if (t_1 <= 5e-124) {
tmp = x;
} else if (t_1 <= 1e+63) {
tmp = x + y;
} 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 = (z - t) / (z - a)
t_2 = (y * t) / a
if (t_1 <= (-1d+38)) then
tmp = t_2
else if (t_1 <= 5d-124) then
tmp = x
else if (t_1 <= 1d+63) then
tmp = x + y
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 = (z - t) / (z - a);
double t_2 = (y * t) / a;
double tmp;
if (t_1 <= -1e+38) {
tmp = t_2;
} else if (t_1 <= 5e-124) {
tmp = x;
} else if (t_1 <= 1e+63) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y * t) / a tmp = 0 if t_1 <= -1e+38: tmp = t_2 elif t_1 <= 5e-124: tmp = x elif t_1 <= 1e+63: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y * t) / a) tmp = 0.0 if (t_1 <= -1e+38) tmp = t_2; elseif (t_1 <= 5e-124) tmp = x; elseif (t_1 <= 1e+63) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y * t) / a; tmp = 0.0; if (t_1 <= -1e+38) tmp = t_2; elseif (t_1 <= 5e-124) tmp = x; elseif (t_1 <= 1e+63) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+38], t$95$2, If[LessEqual[t$95$1, 5e-124], x, If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y \cdot t}{a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+38}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-124}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999977e37 or 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.6%
Taylor expanded in a around inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6461.7
Applied rewrites61.7%
Taylor expanded in t around inf
lift-/.f64N/A
*-commutativeN/A
lower-*.f6444.7
Applied rewrites44.7%
if -9.99999999999999977e37 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000003e-124Initial program 99.3%
Taylor expanded in x around inf
Applied rewrites71.6%
if 5.0000000000000003e-124 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 99.9%
Taylor expanded in z around inf
Applied rewrites85.7%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (- z t) (- z a)) 1.15e-119) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - t) / (z - a)) <= 1.15e-119) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 - t) / (z - a)) <= 1.15d-119) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - t) / (z - a)) <= 1.15e-119) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((z - t) / (z - a)) <= 1.15e-119: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(z - t) / Float64(z - a)) <= 1.15e-119) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((z - t) / (z - a)) <= 1.15e-119) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], 1.15e-119], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z - t}{z - a} \leq 1.15 \cdot 10^{-119}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.14999999999999997e-119Initial program 98.1%
Taylor expanded in x around inf
Applied rewrites57.3%
if 1.14999999999999997e-119 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.6%
Taylor expanded in z around inf
Applied rewrites73.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.65e-87) x (if (<= x 7.5e-122) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.65e-87) {
tmp = x;
} else if (x <= 7.5e-122) {
tmp = y;
} 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, 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 (x <= (-1.65d-87)) then
tmp = x
else if (x <= 7.5d-122) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.65e-87) {
tmp = x;
} else if (x <= 7.5e-122) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.65e-87: tmp = x elif x <= 7.5e-122: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.65e-87) tmp = x; elseif (x <= 7.5e-122) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.65e-87) tmp = x; elseif (x <= 7.5e-122) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.65e-87], x, If[LessEqual[x, 7.5e-122], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-87}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-122}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.65e-87 or 7.4999999999999998e-122 < x Initial program 98.6%
Taylor expanded in x around inf
Applied rewrites64.6%
if -1.65e-87 < x < 7.4999999999999998e-122Initial program 98.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6458.9
Applied rewrites58.9%
Taylor expanded in x around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6438.4
Applied rewrites38.4%
Taylor expanded in z around inf
Applied rewrites29.4%
(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 98.4%
Taylor expanded in x around inf
Applied rewrites50.7%
herbie shell --seed 2025130
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
(+ x (* y (/ (- z t) (- z a)))))