
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
(if (<= t_2 -4e-212)
t_2
(if (<= t_2 5e-202)
(fma (- (- t x)) (/ (- y a) z) t)
(fma t_1 (- y z) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = x + ((y - z) * t_1);
double tmp;
if (t_2 <= -4e-212) {
tmp = t_2;
} else if (t_2 <= 5e-202) {
tmp = fma(-(t - x), ((y - a) / z), t);
} else {
tmp = fma(t_1, (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_2 <= -4e-212) tmp = t_2; elseif (t_2 <= 5e-202) tmp = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t); else tmp = fma(t_1, Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-212], t$95$2, If[LessEqual[t$95$2, 5e-202], N[((-N[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-202}:\\
\;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.99999999999999982e-212Initial program 92.1%
if -3.99999999999999982e-212 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999973e-202Initial program 12.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6488.2
Applied rewrites88.2%
if 4.99999999999999973e-202 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.1
Applied rewrites91.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
(if (or (<= t_2 -4e-212) (not (<= t_2 5e-202)))
(fma t_1 (- y z) x)
(fma (- (- t x)) (/ (- y a) z) t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = x + ((y - z) * t_1);
double tmp;
if ((t_2 <= -4e-212) || !(t_2 <= 5e-202)) {
tmp = fma(t_1, (y - z), x);
} else {
tmp = fma(-(t - x), ((y - a) / z), t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if ((t_2 <= -4e-212) || !(t_2 <= 5e-202)) tmp = fma(t_1, Float64(y - z), x); else tmp = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -4e-212], N[Not[LessEqual[t$95$2, 5e-202]], $MachinePrecision]], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[((-N[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-212} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-202}\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.99999999999999982e-212 or 4.99999999999999973e-202 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.6
Applied rewrites91.6%
if -3.99999999999999982e-212 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999973e-202Initial program 12.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6488.2
Applied rewrites88.2%
Final simplification91.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* (/ (- y a) z) x) t)))
(if (<= z -1.7e+32)
t_1
(if (<= z -2.3e-134)
(* (- t x) (/ y (- a z)))
(if (<= z 7.2e-93)
(+ x (/ (* (- t x) y) a))
(if (<= z 4.3e+166) (* (- y z) (/ t (- a z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (((y - a) / z) * x) + t;
double tmp;
if (z <= -1.7e+32) {
tmp = t_1;
} else if (z <= -2.3e-134) {
tmp = (t - x) * (y / (a - z));
} else if (z <= 7.2e-93) {
tmp = x + (((t - x) * y) / a);
} else if (z <= 4.3e+166) {
tmp = (y - z) * (t / (a - z));
} else {
tmp = t_1;
}
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 - a) / z) * x) + t
if (z <= (-1.7d+32)) then
tmp = t_1
else if (z <= (-2.3d-134)) then
tmp = (t - x) * (y / (a - z))
else if (z <= 7.2d-93) then
tmp = x + (((t - x) * y) / a)
else if (z <= 4.3d+166) then
tmp = (y - z) * (t / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (((y - a) / z) * x) + t;
double tmp;
if (z <= -1.7e+32) {
tmp = t_1;
} else if (z <= -2.3e-134) {
tmp = (t - x) * (y / (a - z));
} else if (z <= 7.2e-93) {
tmp = x + (((t - x) * y) / a);
} else if (z <= 4.3e+166) {
tmp = (y - z) * (t / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (((y - a) / z) * x) + t tmp = 0 if z <= -1.7e+32: tmp = t_1 elif z <= -2.3e-134: tmp = (t - x) * (y / (a - z)) elif z <= 7.2e-93: tmp = x + (((t - x) * y) / a) elif z <= 4.3e+166: tmp = (y - z) * (t / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(y - a) / z) * x) + t) tmp = 0.0 if (z <= -1.7e+32) tmp = t_1; elseif (z <= -2.3e-134) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (z <= 7.2e-93) tmp = Float64(x + Float64(Float64(Float64(t - x) * y) / a)); elseif (z <= 4.3e+166) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (((y - a) / z) * x) + t; tmp = 0.0; if (z <= -1.7e+32) tmp = t_1; elseif (z <= -2.3e-134) tmp = (t - x) * (y / (a - z)); elseif (z <= 7.2e-93) tmp = x + (((t - x) * y) / a); elseif (z <= 4.3e+166) tmp = (y - z) * (t / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.7e+32], t$95$1, If[LessEqual[z, -2.3e-134], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-93], N[(x + N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+166], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - a}{z} \cdot x + t\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-134}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-93}:\\
\;\;\;\;x + \frac{\left(t - x\right) \cdot y}{a}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+166}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.69999999999999989e32 or 4.3e166 < z Initial program 61.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.2
Applied rewrites62.2%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites69.3%
Taylor expanded in x around inf
Applied rewrites72.7%
if -1.69999999999999989e32 < z < -2.3e-134Initial program 93.4%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6470.2
Applied rewrites70.2%
if -2.3e-134 < z < 7.2000000000000003e-93Initial program 88.4%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.8
Applied rewrites84.8%
if 7.2000000000000003e-93 < z < 4.3e166Initial program 80.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6463.9
Applied rewrites63.9%
Final simplification74.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* (/ (- y a) z) x) t)))
(if (<= z -1.7e+32)
t_1
(if (<= z -7.5e-69)
(* (- t x) (/ y (- a z)))
(if (<= z 2.6e-43)
(fma (/ (- t x) a) y x)
(if (<= z 4.3e+166) (* (- y z) (/ t (- a z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (((y - a) / z) * x) + t;
double tmp;
if (z <= -1.7e+32) {
tmp = t_1;
} else if (z <= -7.5e-69) {
tmp = (t - x) * (y / (a - z));
} else if (z <= 2.6e-43) {
tmp = fma(((t - x) / a), y, x);
} else if (z <= 4.3e+166) {
tmp = (y - z) * (t / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(y - a) / z) * x) + t) tmp = 0.0 if (z <= -1.7e+32) tmp = t_1; elseif (z <= -7.5e-69) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (z <= 2.6e-43) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (z <= 4.3e+166) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.7e+32], t$95$1, If[LessEqual[z, -7.5e-69], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-43], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 4.3e+166], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - a}{z} \cdot x + t\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-69}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-43}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+166}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.69999999999999989e32 or 4.3e166 < z Initial program 61.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.2
Applied rewrites62.2%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites69.3%
Taylor expanded in x around inf
Applied rewrites72.7%
if -1.69999999999999989e32 < z < -7.5e-69Initial program 95.3%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6479.3
Applied rewrites79.3%
if -7.5e-69 < z < 2.6e-43Initial program 87.7%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.2
Applied rewrites78.2%
if 2.6e-43 < z < 4.3e166Initial program 80.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6463.2
Applied rewrites63.2%
Final simplification73.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y z) (/ t (- a z)))))
(if (<= z -2.1e+218)
(fma (/ (- t x) z) a t)
(if (<= z -5.5e+79)
t_1
(if (<= z -7.5e-69)
(* (- t x) (/ y (- a z)))
(if (<= z 2.6e-43) (fma (/ (- t x) a) y x) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) * (t / (a - z));
double tmp;
if (z <= -2.1e+218) {
tmp = fma(((t - x) / z), a, t);
} else if (z <= -5.5e+79) {
tmp = t_1;
} else if (z <= -7.5e-69) {
tmp = (t - x) * (y / (a - z));
} else if (z <= 2.6e-43) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) * Float64(t / Float64(a - z))) tmp = 0.0 if (z <= -2.1e+218) tmp = fma(Float64(Float64(t - x) / z), a, t); elseif (z <= -5.5e+79) tmp = t_1; elseif (z <= -7.5e-69) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (z <= 2.6e-43) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+218], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * a + t), $MachinePrecision], If[LessEqual[z, -5.5e+79], t$95$1, If[LessEqual[z, -7.5e-69], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-43], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+218}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a, t\right)\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-69}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-43}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.0999999999999999e218Initial program 34.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6434.8
Applied rewrites34.8%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites71.7%
Taylor expanded in y around 0
Applied rewrites62.9%
if -2.0999999999999999e218 < z < -5.50000000000000007e79 or 2.6e-43 < z Initial program 74.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6465.1
Applied rewrites65.1%
if -5.50000000000000007e79 < z < -7.5e-69Initial program 88.6%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6471.9
Applied rewrites71.9%
if -7.5e-69 < z < 2.6e-43Initial program 87.7%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.2
Applied rewrites78.2%
Final simplification71.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- t x) (/ y (- a z)))))
(if (<= z -6.6e+112)
(fma (/ (- t x) z) a t)
(if (<= z -7.5e-69)
t_1
(if (<= z 9.6e-58)
(fma (/ (- t x) a) y x)
(if (<= z 2.6e+74) t_1 (* (- t) (/ z (- a z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) * (y / (a - z));
double tmp;
if (z <= -6.6e+112) {
tmp = fma(((t - x) / z), a, t);
} else if (z <= -7.5e-69) {
tmp = t_1;
} else if (z <= 9.6e-58) {
tmp = fma(((t - x) / a), y, x);
} else if (z <= 2.6e+74) {
tmp = t_1;
} else {
tmp = -t * (z / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) * Float64(y / Float64(a - z))) tmp = 0.0 if (z <= -6.6e+112) tmp = fma(Float64(Float64(t - x) / z), a, t); elseif (z <= -7.5e-69) tmp = t_1; elseif (z <= 9.6e-58) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (z <= 2.6e+74) tmp = t_1; else tmp = Float64(Float64(-t) * Float64(z / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+112], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * a + t), $MachinePrecision], If[LessEqual[z, -7.5e-69], t$95$1, If[LessEqual[z, 9.6e-58], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 2.6e+74], t$95$1, N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a, t\right)\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if z < -6.5999999999999998e112Initial program 57.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6457.4
Applied rewrites57.4%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites67.7%
Taylor expanded in y around 0
Applied rewrites60.0%
if -6.5999999999999998e112 < z < -7.5e-69 or 9.6000000000000002e-58 < z < 2.6000000000000001e74Initial program 89.5%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6464.7
Applied rewrites64.7%
if -7.5e-69 < z < 9.6000000000000002e-58Initial program 87.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.0
Applied rewrites78.0%
if 2.6000000000000001e74 < z Initial program 62.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6464.5
Applied rewrites64.5%
Taylor expanded in y around 0
Applied rewrites67.3%
Final simplification69.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y (- a z)))))
(if (<= z -2.25e+43)
(* (- t) -1.0)
(if (<= z -1.3e-45)
t_1
(if (<= z 8.5e-160)
(fma x (/ z a) x)
(if (<= z 3e-28) t_1 (fma a (/ t z) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / (a - z));
double tmp;
if (z <= -2.25e+43) {
tmp = -t * -1.0;
} else if (z <= -1.3e-45) {
tmp = t_1;
} else if (z <= 8.5e-160) {
tmp = fma(x, (z / a), x);
} else if (z <= 3e-28) {
tmp = t_1;
} else {
tmp = fma(a, (t / z), t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / Float64(a - z))) tmp = 0.0 if (z <= -2.25e+43) tmp = Float64(Float64(-t) * -1.0); elseif (z <= -1.3e-45) tmp = t_1; elseif (z <= 8.5e-160) tmp = fma(x, Float64(z / a), x); elseif (z <= 3e-28) tmp = t_1; else tmp = fma(a, Float64(t / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.25e+43], N[((-t) * -1.0), $MachinePrecision], If[LessEqual[z, -1.3e-45], t$95$1, If[LessEqual[z, 8.5e-160], N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 3e-28], t$95$1, N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a - z}\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+43}:\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-160}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\end{array}
\end{array}
if z < -2.25e43Initial program 63.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6456.5
Applied rewrites56.5%
Taylor expanded in y around 0
Applied rewrites54.1%
Taylor expanded in z around inf
Applied rewrites46.2%
if -2.25e43 < z < -1.29999999999999993e-45 or 8.49999999999999959e-160 < z < 3.00000000000000003e-28Initial program 87.2%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6453.9
Applied rewrites53.9%
Taylor expanded in y around inf
Applied rewrites51.2%
if -1.29999999999999993e-45 < z < 8.49999999999999959e-160Initial program 89.4%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-/l*N/A
associate-*r*N/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6467.5
Applied rewrites67.5%
Taylor expanded in y around 0
Applied rewrites39.6%
Taylor expanded in z around 0
Applied rewrites40.6%
if 3.00000000000000003e-28 < z Initial program 71.4%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6459.1
Applied rewrites59.1%
Taylor expanded in y around 0
Applied rewrites53.4%
Taylor expanded in z around inf
Applied rewrites42.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.7e+32)
(fma (- y a) (/ (- x) (- z)) t)
(if (<= z -1.02e-66)
(* (- t x) (/ y (- a z)))
(if (<= z 9.2e+52)
(fma (- y z) (/ (- t x) a) x)
(+ (* (/ (- y a) z) x) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+32) {
tmp = fma((y - a), (-x / -z), t);
} else if (z <= -1.02e-66) {
tmp = (t - x) * (y / (a - z));
} else if (z <= 9.2e+52) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = (((y - a) / z) * x) + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+32) tmp = fma(Float64(y - a), Float64(Float64(-x) / Float64(-z)), t); elseif (z <= -1.02e-66) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (z <= 9.2e+52) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); else tmp = Float64(Float64(Float64(Float64(y - a) / z) * x) + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+32], N[(N[(y - a), $MachinePrecision] * N[((-x) / (-z)), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -1.02e-66], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+52], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(y - a, \frac{-x}{-z}, t\right)\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-66}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y - a}{z} \cdot x + t\\
\end{array}
\end{array}
if z < -1.69999999999999989e32Initial program 62.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6463.0
Applied rewrites63.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites69.9%
Taylor expanded in x around inf
Applied rewrites66.4%
Applied rewrites66.6%
if -1.69999999999999989e32 < z < -1.01999999999999996e-66Initial program 95.3%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6479.3
Applied rewrites79.3%
if -1.01999999999999996e-66 < z < 9.1999999999999999e52Initial program 88.6%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.3
Applied rewrites76.3%
if 9.1999999999999999e52 < z Initial program 64.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6465.3
Applied rewrites65.3%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites60.6%
Taylor expanded in x around inf
Applied rewrites71.3%
Final simplification73.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* (/ (- y a) z) x) t)))
(if (<= z -1.7e+32)
t_1
(if (<= z -1.02e-66)
(* (- t x) (/ y (- a z)))
(if (<= z 9.2e+52) (fma (- y z) (/ (- t x) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (((y - a) / z) * x) + t;
double tmp;
if (z <= -1.7e+32) {
tmp = t_1;
} else if (z <= -1.02e-66) {
tmp = (t - x) * (y / (a - z));
} else if (z <= 9.2e+52) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(y - a) / z) * x) + t) tmp = 0.0 if (z <= -1.7e+32) tmp = t_1; elseif (z <= -1.02e-66) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (z <= 9.2e+52) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.7e+32], t$95$1, If[LessEqual[z, -1.02e-66], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+52], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - a}{z} \cdot x + t\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-66}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.69999999999999989e32 or 9.1999999999999999e52 < z Initial program 63.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6464.0
Applied rewrites64.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites65.6%
Taylor expanded in x around inf
Applied rewrites68.7%
if -1.69999999999999989e32 < z < -1.01999999999999996e-66Initial program 95.3%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6479.3
Applied rewrites79.3%
if -1.01999999999999996e-66 < z < 9.1999999999999999e52Initial program 88.6%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.3
Applied rewrites76.3%
Final simplification73.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.0068) (not (<= z 2.35e-57))) (fma (- (- t x)) (/ (- y a) z) t) (+ x (* (/ (- y z) a) (- t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.0068) || !(z <= 2.35e-57)) {
tmp = fma(-(t - x), ((y - a) / z), t);
} else {
tmp = x + (((y - z) / a) * (t - x));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.0068) || !(z <= 2.35e-57)) tmp = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t); else tmp = Float64(x + Float64(Float64(Float64(y - z) / a) * Float64(t - x))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.0068], N[Not[LessEqual[z, 2.35e-57]], $MachinePrecision]], N[((-N[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(x + N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0068 \lor \neg \left(z \leq 2.35 \cdot 10^{-57}\right):\\
\;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{a} \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -0.00679999999999999962 or 2.3499999999999999e-57 < z Initial program 70.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.2
Applied rewrites77.2%
if -0.00679999999999999962 < z < 2.3499999999999999e-57Initial program 88.4%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6481.4
Applied rewrites81.4%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.0068) (not (<= z 2.35e-57))) (fma (- (- t x)) (/ (- y a) z) t) (fma (- y z) (/ (- t x) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.0068) || !(z <= 2.35e-57)) {
tmp = fma(-(t - x), ((y - a) / z), t);
} else {
tmp = fma((y - z), ((t - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.0068) || !(z <= 2.35e-57)) tmp = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t); else tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.0068], N[Not[LessEqual[z, 2.35e-57]], $MachinePrecision]], N[((-N[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0068 \lor \neg \left(z \leq 2.35 \cdot 10^{-57}\right):\\
\;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if z < -0.00679999999999999962 or 2.3499999999999999e-57 < z Initial program 70.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.2
Applied rewrites77.2%
if -0.00679999999999999962 < z < 2.3499999999999999e-57Initial program 88.4%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.3
Applied rewrites78.3%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.2e+32) (fma (/ (- t x) z) a t) (if (<= z 2.3e+58) (fma (/ (- t x) a) y x) (* (- t) (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+32) {
tmp = fma(((t - x) / z), a, t);
} else if (z <= 2.3e+58) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = -t * (z / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e+32) tmp = fma(Float64(Float64(t - x) / z), a, t); elseif (z <= 2.3e+58) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = Float64(Float64(-t) * Float64(z / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+32], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * a + t), $MachinePrecision], If[LessEqual[z, 2.3e+58], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a, t\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if z < -3.1999999999999999e32Initial program 62.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6463.0
Applied rewrites63.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites69.9%
Taylor expanded in y around 0
Applied rewrites54.5%
if -3.1999999999999999e32 < z < 2.30000000000000002e58Initial program 89.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.8
Applied rewrites70.8%
if 2.30000000000000002e58 < z Initial program 64.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6463.8
Applied rewrites63.8%
Taylor expanded in y around 0
Applied rewrites62.1%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+32) (not (<= z 2.15e+58))) (fma (/ (- t x) z) a t) (fma (/ (- t x) a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+32) || !(z <= 2.15e+58)) {
tmp = fma(((t - x) / z), a, t);
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+32) || !(z <= 2.15e+58)) tmp = fma(Float64(Float64(t - x) / z), a, t); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+32], N[Not[LessEqual[z, 2.15e+58]], $MachinePrecision]], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * a + t), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+32} \lor \neg \left(z \leq 2.15 \cdot 10^{+58}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if z < -3.1999999999999999e32 or 2.14999999999999996e58 < z Initial program 63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6463.7
Applied rewrites63.7%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites65.3%
Taylor expanded in y around 0
Applied rewrites53.6%
if -3.1999999999999999e32 < z < 2.14999999999999996e58Initial program 89.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.8
Applied rewrites70.8%
Final simplification63.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+38) (not (<= z 2.8e+58))) (* (- t) -1.0) (fma (/ (- t x) a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+38) || !(z <= 2.8e+58)) {
tmp = -t * -1.0;
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+38) || !(z <= 2.8e+58)) tmp = Float64(Float64(-t) * -1.0); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+38], N[Not[LessEqual[z, 2.8e+58]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+38} \lor \neg \left(z \leq 2.8 \cdot 10^{+58}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if z < -4.80000000000000035e38 or 2.7999999999999998e58 < z Initial program 63.9%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.3
Applied rewrites60.3%
Taylor expanded in y around 0
Applied rewrites57.3%
Taylor expanded in z around inf
Applied rewrites47.4%
if -4.80000000000000035e38 < z < 2.7999999999999998e58Initial program 89.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.4
Applied rewrites70.4%
Final simplification60.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+38) (not (<= z 9e+56))) (* (- t) -1.0) (fma (- x) (/ y a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+38) || !(z <= 9e+56)) {
tmp = -t * -1.0;
} else {
tmp = fma(-x, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+38) || !(z <= 9e+56)) tmp = Float64(Float64(-t) * -1.0); else tmp = fma(Float64(-x), Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+38], N[Not[LessEqual[z, 9e+56]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+38} \lor \neg \left(z \leq 9 \cdot 10^{+56}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if z < -4.80000000000000035e38 or 9.0000000000000006e56 < z Initial program 63.9%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.3
Applied rewrites60.3%
Taylor expanded in y around 0
Applied rewrites57.3%
Taylor expanded in z around inf
Applied rewrites47.4%
if -4.80000000000000035e38 < z < 9.0000000000000006e56Initial program 89.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-/l*N/A
associate-*r*N/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6460.3
Applied rewrites60.3%
Taylor expanded in z around 0
Applied rewrites54.1%
Final simplification51.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.5e+31) (* (- t) -1.0) (if (<= z 2.7e-91) (fma x (/ z a) x) (fma a (/ t z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+31) {
tmp = -t * -1.0;
} else if (z <= 2.7e-91) {
tmp = fma(x, (z / a), x);
} else {
tmp = fma(a, (t / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+31) tmp = Float64(Float64(-t) * -1.0); elseif (z <= 2.7e-91) tmp = fma(x, Float64(z / a), x); else tmp = fma(a, Float64(t / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+31], N[((-t) * -1.0), $MachinePrecision], If[LessEqual[z, 2.7e-91], N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+31}:\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-91}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\end{array}
\end{array}
if z < -3.5e31Initial program 62.7%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6456.3
Applied rewrites56.3%
Taylor expanded in y around 0
Applied rewrites52.4%
Taylor expanded in z around inf
Applied rewrites44.8%
if -3.5e31 < z < 2.6999999999999997e-91Initial program 89.8%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-/l*N/A
associate-*r*N/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6464.2
Applied rewrites64.2%
Taylor expanded in y around 0
Applied rewrites36.1%
Taylor expanded in z around 0
Applied rewrites36.9%
if 2.6999999999999997e-91 < z Initial program 73.7%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6462.1
Applied rewrites62.1%
Taylor expanded in y around 0
Applied rewrites47.4%
Taylor expanded in z around inf
Applied rewrites39.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.2e+21) (* (- t) -1.0) (if (<= z 3e-28) (* t (/ y a)) (fma a (/ t z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+21) {
tmp = -t * -1.0;
} else if (z <= 3e-28) {
tmp = t * (y / a);
} else {
tmp = fma(a, (t / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+21) tmp = Float64(Float64(-t) * -1.0); elseif (z <= 3e-28) tmp = Float64(t * Float64(y / a)); else tmp = fma(a, Float64(t / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+21], N[((-t) * -1.0), $MachinePrecision], If[LessEqual[z, 3e-28], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+21}:\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-28}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\end{array}
\end{array}
if z < -5.2e21Initial program 63.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6455.4
Applied rewrites55.4%
Taylor expanded in y around 0
Applied rewrites51.5%
Taylor expanded in z around inf
Applied rewrites44.1%
if -5.2e21 < z < 3.00000000000000003e-28Initial program 89.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6436.4
Applied rewrites36.4%
Taylor expanded in y around 0
Applied rewrites7.2%
Taylor expanded in z around 0
Applied rewrites28.4%
if 3.00000000000000003e-28 < z Initial program 71.4%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6459.1
Applied rewrites59.1%
Taylor expanded in y around 0
Applied rewrites53.4%
Taylor expanded in z around inf
Applied rewrites42.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+21) (not (<= z 3e-28))) (* (- t) -1.0) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+21) || !(z <= 3e-28)) {
tmp = -t * -1.0;
} else {
tmp = t * (y / 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) :: tmp
if ((z <= (-5.2d+21)) .or. (.not. (z <= 3d-28))) then
tmp = -t * (-1.0d0)
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+21) || !(z <= 3e-28)) {
tmp = -t * -1.0;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+21) or not (z <= 3e-28): tmp = -t * -1.0 else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+21) || !(z <= 3e-28)) tmp = Float64(Float64(-t) * -1.0); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+21) || ~((z <= 3e-28))) tmp = -t * -1.0; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+21], N[Not[LessEqual[z, 3e-28]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+21} \lor \neg \left(z \leq 3 \cdot 10^{-28}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.2e21 or 3.00000000000000003e-28 < z Initial program 67.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6457.4
Applied rewrites57.4%
Taylor expanded in y around 0
Applied rewrites52.5%
Taylor expanded in z around inf
Applied rewrites43.0%
if -5.2e21 < z < 3.00000000000000003e-28Initial program 89.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6436.4
Applied rewrites36.4%
Taylor expanded in y around 0
Applied rewrites7.2%
Taylor expanded in z around 0
Applied rewrites28.4%
Final simplification35.6%
(FPCore (x y z t a) :precision binary64 (* (- t) -1.0))
double code(double x, double y, double z, double t, double a) {
return -t * -1.0;
}
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 = -t * (-1.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return -t * -1.0;
}
def code(x, y, z, t, a): return -t * -1.0
function code(x, y, z, t, a) return Float64(Float64(-t) * -1.0) end
function tmp = code(x, y, z, t, a) tmp = -t * -1.0; end
code[x_, y_, z_, t_, a_] := N[((-t) * -1.0), $MachinePrecision]
\begin{array}{l}
\\
\left(-t\right) \cdot -1
\end{array}
Initial program 78.7%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6446.7
Applied rewrites46.7%
Taylor expanded in y around 0
Applied rewrites29.3%
Taylor expanded in z around inf
Applied rewrites23.9%
(FPCore (x y z t a) :precision binary64 (+ x (- t x)))
double code(double x, double y, double z, double t, double a) {
return x + (t - 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 + (t - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
def code(x, y, z, t, a): return x + (t - x)
function code(x, y, z, t, a) return Float64(x + Float64(t - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (t - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right)
\end{array}
Initial program 78.7%
Taylor expanded in z around inf
lower--.f6417.4
Applied rewrites17.4%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 78.7%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-/l*N/A
associate-*r*N/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6443.1
Applied rewrites43.1%
Taylor expanded in z around inf
Applied rewrites2.8%
Taylor expanded in x around 0
Applied rewrites2.8%
herbie shell --seed 2025008
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))