
(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 (fma t_1 (- y z) x))
(t_3 (+ x (* (- y z) t_1))))
(if (<= t_3 -1e-291)
t_2
(if (<= t_3 2e-276)
(fma (- (- t x)) (/ (- y a) z) t)
(if (<= t_3 4e+307) t_2 (+ x (/ (* (- t x) (- y z)) (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = fma(t_1, (y - z), x);
double t_3 = x + ((y - z) * t_1);
double tmp;
if (t_3 <= -1e-291) {
tmp = t_2;
} else if (t_3 <= 2e-276) {
tmp = fma(-(t - x), ((y - a) / z), t);
} else if (t_3 <= 4e+307) {
tmp = t_2;
} else {
tmp = x + (((t - x) * (y - z)) / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = fma(t_1, Float64(y - z), x) t_3 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_3 <= -1e-291) tmp = t_2; elseif (t_3 <= 2e-276) tmp = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t); elseif (t_3 <= 4e+307) tmp = t_2; else tmp = Float64(x + Float64(Float64(Float64(t - x) * Float64(y - z)) / Float64(a - z))); 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[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-291], t$95$2, If[LessEqual[t$95$3, 2e-276], N[((-N[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$3, 4e+307], t$95$2, N[(x + N[(N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(t\_1, y - z, x\right)\\
t_3 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-291}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-276}:\\
\;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(t - x\right) \cdot \left(y - z\right)}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999962e-292 or 2e-276 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.99999999999999994e307Initial program 91.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.8
Applied rewrites91.8%
if -9.99999999999999962e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-276Initial program 3.3%
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--.f6499.9
Applied rewrites99.9%
if 3.99999999999999994e307 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 74.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
(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 -1e-291) (not (<= t_2 2e-276)))
(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 <= -1e-291) || !(t_2 <= 2e-276)) {
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 <= -1e-291) || !(t_2 <= 2e-276)) 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, -1e-291], N[Not[LessEqual[t$95$2, 2e-276]], $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 -1 \cdot 10^{-291} \lor \neg \left(t\_2 \leq 2 \cdot 10^{-276}\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)))) < -9.99999999999999962e-292 or 2e-276 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 89.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6490.0
Applied rewrites90.0%
if -9.99999999999999962e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-276Initial program 3.3%
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--.f6499.9
Applied rewrites99.9%
Final simplification91.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- t x) (/ y (- a z)))))
(if (<= z -7.2e+148)
(fma a (/ (- t x) z) t)
(if (<= z -2.35e-86)
(fma (- z) (/ (- t x) (- a z)) x)
(if (<= z -5.8e-161)
t_1
(if (<= z 1.45e-13)
(fma (- y z) (/ (- t x) a) x)
(if (<= z 2.45e+134) t_1 (fma a (/ (- x) z) t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) * (y / (a - z));
double tmp;
if (z <= -7.2e+148) {
tmp = fma(a, ((t - x) / z), t);
} else if (z <= -2.35e-86) {
tmp = fma(-z, ((t - x) / (a - z)), x);
} else if (z <= -5.8e-161) {
tmp = t_1;
} else if (z <= 1.45e-13) {
tmp = fma((y - z), ((t - x) / a), x);
} else if (z <= 2.45e+134) {
tmp = t_1;
} else {
tmp = fma(a, (-x / z), t);
}
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 <= -7.2e+148) tmp = fma(a, Float64(Float64(t - x) / z), t); elseif (z <= -2.35e-86) tmp = fma(Float64(-z), Float64(Float64(t - x) / Float64(a - z)), x); elseif (z <= -5.8e-161) tmp = t_1; elseif (z <= 1.45e-13) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); elseif (z <= 2.45e+134) tmp = t_1; else tmp = fma(a, Float64(Float64(-x) / z), t); 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, -7.2e+148], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -2.35e-86], N[((-z) * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, -5.8e-161], t$95$1, If[LessEqual[z, 1.45e-13], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.45e+134], t$95$1, N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-86}:\\
\;\;\;\;\mathsf{fma}\left(-z, \frac{t - x}{a - z}, x\right)\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -7.20000000000000013e148Initial program 61.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.3
Applied rewrites50.3%
Taylor expanded in z around inf
Applied rewrites73.8%
if -7.20000000000000013e148 < z < -2.35e-86Initial program 82.1%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.8
Applied rewrites69.8%
if -2.35e-86 < z < -5.8e-161 or 1.4499999999999999e-13 < z < 2.44999999999999998e134Initial program 78.8%
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--.f6463.9
Applied rewrites63.9%
if -5.8e-161 < z < 1.4499999999999999e-13Initial program 92.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--.f6487.0
Applied rewrites87.0%
if 2.44999999999999998e134 < z Initial program 49.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around inf
Applied rewrites76.4%
Taylor expanded in x around inf
Applied rewrites76.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- (- t x)) (/ (- y a) z) t)))
(if (<= z -7.8e+147)
t_1
(if (<= z -2.35e-86)
(fma (- z) (/ (- t x) (- a z)) x)
(if (<= z -5.8e-161)
(* (- t x) (/ y (- a z)))
(if (<= z 2e-13) (fma (- y z) (/ (- t x) a) x) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-(t - x), ((y - a) / z), t);
double tmp;
if (z <= -7.8e+147) {
tmp = t_1;
} else if (z <= -2.35e-86) {
tmp = fma(-z, ((t - x) / (a - z)), x);
} else if (z <= -5.8e-161) {
tmp = (t - x) * (y / (a - z));
} else if (z <= 2e-13) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -7.8e+147) tmp = t_1; elseif (z <= -2.35e-86) tmp = fma(Float64(-z), Float64(Float64(t - x) / Float64(a - z)), x); elseif (z <= -5.8e-161) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (z <= 2e-13) 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[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -7.8e+147], t$95$1, If[LessEqual[z, -2.35e-86], N[((-z) * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, -5.8e-161], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-13], 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 := \mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-86}:\\
\;\;\;\;\mathsf{fma}\left(-z, \frac{t - x}{a - z}, x\right)\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-161}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.80000000000000033e147 or 2.0000000000000001e-13 < z Initial program 61.1%
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--.f6484.7
Applied rewrites84.7%
if -7.80000000000000033e147 < z < -2.35e-86Initial program 82.1%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.8
Applied rewrites69.8%
if -2.35e-86 < z < -5.8e-161Initial program 87.1%
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--.f6473.9
Applied rewrites73.9%
if -5.8e-161 < z < 2.0000000000000001e-13Initial program 92.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--.f6487.0
Applied rewrites87.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e+180)
(fma a (/ (- t x) z) t)
(if (<= z -2.8e+43)
(* (- y z) (/ t (- a z)))
(if (<= z 1.45e-13)
(fma (- y z) (/ (- t x) a) x)
(if (<= z 2.45e+134)
(* (- t x) (/ y (- a z)))
(fma a (/ (- x) z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+180) {
tmp = fma(a, ((t - x) / z), t);
} else if (z <= -2.8e+43) {
tmp = (y - z) * (t / (a - z));
} else if (z <= 1.45e-13) {
tmp = fma((y - z), ((t - x) / a), x);
} else if (z <= 2.45e+134) {
tmp = (t - x) * (y / (a - z));
} else {
tmp = fma(a, (-x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+180) tmp = fma(a, Float64(Float64(t - x) / z), t); elseif (z <= -2.8e+43) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z))); elseif (z <= 1.45e-13) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); elseif (z <= 2.45e+134) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); else tmp = fma(a, Float64(Float64(-x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+180], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -2.8e+43], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-13], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.45e+134], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+43}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+134}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -1.59999999999999997e180Initial program 59.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6453.7
Applied rewrites53.7%
Taylor expanded in z around inf
Applied rewrites79.3%
if -1.59999999999999997e180 < z < -2.80000000000000019e43Initial program 78.2%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6466.9
Applied rewrites66.9%
if -2.80000000000000019e43 < z < 1.4499999999999999e-13Initial program 90.1%
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.5
Applied rewrites76.5%
if 1.4499999999999999e-13 < z < 2.44999999999999998e134Initial program 74.8%
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--.f6459.1
Applied rewrites59.1%
if 2.44999999999999998e134 < z Initial program 49.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around inf
Applied rewrites76.4%
Taylor expanded in x around inf
Applied rewrites76.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e+180)
(fma a (/ (- t x) z) t)
(if (<= z -1040000000000.0)
(* (- y z) (/ t (- a z)))
(if (<= z 9.5e-14)
(fma (/ (- t x) a) y x)
(if (<= z 2.45e+134)
(* (- t x) (/ y (- a z)))
(fma a (/ (- x) z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+180) {
tmp = fma(a, ((t - x) / z), t);
} else if (z <= -1040000000000.0) {
tmp = (y - z) * (t / (a - z));
} else if (z <= 9.5e-14) {
tmp = fma(((t - x) / a), y, x);
} else if (z <= 2.45e+134) {
tmp = (t - x) * (y / (a - z));
} else {
tmp = fma(a, (-x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+180) tmp = fma(a, Float64(Float64(t - x) / z), t); elseif (z <= -1040000000000.0) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z))); elseif (z <= 9.5e-14) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (z <= 2.45e+134) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); else tmp = fma(a, Float64(Float64(-x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+180], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -1040000000000.0], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-14], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 2.45e+134], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{elif}\;z \leq -1040000000000:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+134}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -1.59999999999999997e180Initial program 59.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6453.7
Applied rewrites53.7%
Taylor expanded in z around inf
Applied rewrites79.3%
if -1.59999999999999997e180 < z < -1.04e12Initial program 77.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6458.2
Applied rewrites58.2%
if -1.04e12 < z < 9.4999999999999999e-14Initial program 91.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if 9.4999999999999999e-14 < z < 2.44999999999999998e134Initial program 75.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--.f6457.4
Applied rewrites57.4%
if 2.44999999999999998e134 < z Initial program 49.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around inf
Applied rewrites76.4%
Taylor expanded in x around inf
Applied rewrites76.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.25e+45)
(* (- t) (/ z (- a z)))
(if (<= z 9.5e-14)
(fma (/ (- t x) a) y x)
(if (<= z 2.45e+134) (* (- t x) (/ y (- a z))) (fma a (/ (- x) z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.25e+45) {
tmp = -t * (z / (a - z));
} else if (z <= 9.5e-14) {
tmp = fma(((t - x) / a), y, x);
} else if (z <= 2.45e+134) {
tmp = (t - x) * (y / (a - z));
} else {
tmp = fma(a, (-x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.25e+45) tmp = Float64(Float64(-t) * Float64(z / Float64(a - z))); elseif (z <= 9.5e-14) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (z <= 2.45e+134) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); else tmp = fma(a, Float64(Float64(-x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e+45], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-14], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 2.45e+134], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+45}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+134}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -2.2499999999999999e45Initial program 67.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6455.7
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites65.8%
if -2.2499999999999999e45 < z < 9.4999999999999999e-14Initial program 90.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.3
Applied rewrites72.3%
if 9.4999999999999999e-14 < z < 2.44999999999999998e134Initial program 75.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--.f6457.4
Applied rewrites57.4%
if 2.44999999999999998e134 < z Initial program 49.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around inf
Applied rewrites76.4%
Taylor expanded in x around inf
Applied rewrites76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -360000000.0) (not (<= z 2.25e-13))) (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 <= -360000000.0) || !(z <= 2.25e-13)) {
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 <= -360000000.0) || !(z <= 2.25e-13)) 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, -360000000.0], N[Not[LessEqual[z, 2.25e-13]], $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 -360000000 \lor \neg \left(z \leq 2.25 \cdot 10^{-13}\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 < -3.6e8 or 2.25e-13 < z Initial program 64.3%
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--.f6479.8
Applied rewrites79.8%
if -3.6e8 < z < 2.25e-13Initial program 91.0%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6481.6
Applied rewrites81.6%
Final simplification80.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.4e+31)
(fma a (/ (- t x) z) t)
(if (<= z -6.8e-193)
(fma (/ z (- a z)) x x)
(if (<= z 4.5e-26) (* (/ y a) (- t x)) (fma a (/ (- x) z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e+31) {
tmp = fma(a, ((t - x) / z), t);
} else if (z <= -6.8e-193) {
tmp = fma((z / (a - z)), x, x);
} else if (z <= 4.5e-26) {
tmp = (y / a) * (t - x);
} else {
tmp = fma(a, (-x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.4e+31) tmp = fma(a, Float64(Float64(t - x) / z), t); elseif (z <= -6.8e-193) tmp = fma(Float64(z / Float64(a - z)), x, x); elseif (z <= 4.5e-26) tmp = Float64(Float64(y / a) * Float64(t - x)); else tmp = fma(a, Float64(Float64(-x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e+31], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -6.8e-193], N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision], If[LessEqual[z, 4.5e-26], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-193}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a - z}, x, x\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -6.4000000000000001e31Initial program 67.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6456.4
Applied rewrites56.4%
Taylor expanded in z around inf
Applied rewrites63.5%
if -6.4000000000000001e31 < z < -6.8000000000000004e-193Initial program 87.7%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6460.5
Applied rewrites60.5%
Taylor expanded in x around inf
Applied rewrites43.0%
if -6.8000000000000004e-193 < z < 4.4999999999999999e-26Initial program 92.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.8
Applied rewrites92.8%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6455.4
Applied rewrites55.4%
Applied rewrites58.4%
Taylor expanded in z around 0
Applied rewrites54.9%
if 4.4999999999999999e-26 < z Initial program 61.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6441.8
Applied rewrites41.8%
Taylor expanded in z around inf
Applied rewrites55.3%
Taylor expanded in x around inf
Applied rewrites55.5%
Final simplification55.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.25e+45) (* (- t) (/ z (- a z))) (if (<= z 2e+138) (fma (/ (- t x) a) y x) (fma a (/ (- x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.25e+45) {
tmp = -t * (z / (a - z));
} else if (z <= 2e+138) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = fma(a, (-x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.25e+45) tmp = Float64(Float64(-t) * Float64(z / Float64(a - z))); elseif (z <= 2e+138) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = fma(a, Float64(Float64(-x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e+45], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+138], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+45}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -2.2499999999999999e45Initial program 67.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6455.7
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites65.8%
if -2.2499999999999999e45 < z < 2.0000000000000001e138Initial program 87.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6464.2
Applied rewrites64.2%
if 2.0000000000000001e138 < z Initial program 48.7%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6446.3
Applied rewrites46.3%
Taylor expanded in z around inf
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites78.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1150000000000.0) (* (- t) (/ (- y z) z)) (if (<= z 2e+138) (fma (/ (- t x) a) y x) (fma a (/ (- x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1150000000000.0) {
tmp = -t * ((y - z) / z);
} else if (z <= 2e+138) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = fma(a, (-x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1150000000000.0) tmp = Float64(Float64(-t) * Float64(Float64(y - z) / z)); elseif (z <= 2e+138) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = fma(a, Float64(Float64(-x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1150000000000.0], N[((-t) * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+138], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1150000000000:\\
\;\;\;\;\left(-t\right) \cdot \frac{y - z}{z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -1.15e12Initial program 68.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.4
Applied rewrites60.4%
Taylor expanded in a around 0
Applied rewrites60.8%
if -1.15e12 < z < 2.0000000000000001e138Initial 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--.f6466.0
Applied rewrites66.0%
if 2.0000000000000001e138 < z Initial program 48.7%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6446.3
Applied rewrites46.3%
Taylor expanded in z around inf
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites78.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.12e+30) (fma a (/ (- t x) z) t) (if (<= z 2e+138) (fma (/ (- t x) a) y x) (fma a (/ (- x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.12e+30) {
tmp = fma(a, ((t - x) / z), t);
} else if (z <= 2e+138) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = fma(a, (-x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.12e+30) tmp = fma(a, Float64(Float64(t - x) / z), t); elseif (z <= 2e+138) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = fma(a, Float64(Float64(-x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.12e+30], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 2e+138], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\end{array}
\end{array}
if z < -1.12e30Initial program 66.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6455.5
Applied rewrites55.5%
Taylor expanded in z around inf
Applied rewrites62.5%
if -1.12e30 < z < 2.0000000000000001e138Initial program 88.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.1
Applied rewrites65.1%
if 2.0000000000000001e138 < z Initial program 48.7%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6446.3
Applied rewrites46.3%
Taylor expanded in z around inf
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e-64) (not (<= z 4.5e-26))) (fma a (/ (- x) z) t) (* (/ y a) (- t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e-64) || !(z <= 4.5e-26)) {
tmp = fma(a, (-x / z), t);
} else {
tmp = (y / a) * (t - x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e-64) || !(z <= 4.5e-26)) tmp = fma(a, Float64(Float64(-x) / z), t); else tmp = Float64(Float64(y / a) * Float64(t - x)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e-64], N[Not[LessEqual[z, 4.5e-26]], $MachinePrecision]], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-64} \lor \neg \left(z \leq 4.5 \cdot 10^{-26}\right):\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -2.6e-64 or 4.4999999999999999e-26 < z Initial program 66.2%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9
Applied rewrites50.9%
Taylor expanded in z around inf
Applied rewrites54.7%
Taylor expanded in x around inf
Applied rewrites55.3%
if -2.6e-64 < z < 4.4999999999999999e-26Initial program 92.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.4
Applied rewrites92.4%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.5
Applied rewrites54.5%
Applied rewrites57.8%
Taylor expanded in z around 0
Applied rewrites48.0%
Final simplification52.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e-64) (not (<= z 4.5e-26))) (fma a (/ (- x) z) t) (* (/ (- t x) a) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e-64) || !(z <= 4.5e-26)) {
tmp = fma(a, (-x / z), t);
} else {
tmp = ((t - x) / a) * y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e-64) || !(z <= 4.5e-26)) tmp = fma(a, Float64(Float64(-x) / z), t); else tmp = Float64(Float64(Float64(t - x) / a) * y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e-64], N[Not[LessEqual[z, 4.5e-26]], $MachinePrecision]], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-64} \lor \neg \left(z \leq 4.5 \cdot 10^{-26}\right):\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\end{array}
\end{array}
if z < -2.6e-64 or 4.4999999999999999e-26 < z Initial program 66.2%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.9
Applied rewrites50.9%
Taylor expanded in z around inf
Applied rewrites54.7%
Taylor expanded in x around inf
Applied rewrites55.3%
if -2.6e-64 < z < 4.4999999999999999e-26Initial program 92.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.4
Applied rewrites92.4%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.5
Applied rewrites54.5%
Applied rewrites57.8%
Taylor expanded in z around 0
Applied rewrites47.4%
Final simplification52.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e-74) (not (<= z 4.5e-26))) (fma a (/ (- x) z) t) (* t (/ y (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e-74) || !(z <= 4.5e-26)) {
tmp = fma(a, (-x / z), t);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e-74) || !(z <= 4.5e-26)) tmp = fma(a, Float64(Float64(-x) / z), t); else tmp = Float64(t * Float64(y / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e-74], N[Not[LessEqual[z, 4.5e-26]], $MachinePrecision]], N[(a * N[((-x) / z), $MachinePrecision] + t), $MachinePrecision], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-74} \lor \neg \left(z \leq 4.5 \cdot 10^{-26}\right):\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-x}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.8000000000000001e-74 or 4.4999999999999999e-26 < z Initial program 66.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.6
Applied rewrites50.6%
Taylor expanded in z around inf
Applied rewrites54.3%
Taylor expanded in x around inf
Applied rewrites55.0%
if -1.8000000000000001e-74 < z < 4.4999999999999999e-26Initial program 92.4%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6437.2
Applied rewrites37.2%
Taylor expanded in y around inf
Applied rewrites34.0%
Final simplification46.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.82e-84) (* (- t) -1.0) (if (<= z 2.9e+132) (* t (/ y (- a z))) (fma a (/ t z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.82e-84) {
tmp = -t * -1.0;
} else if (z <= 2.9e+132) {
tmp = t * (y / (a - z));
} else {
tmp = fma(a, (t / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.82e-84) tmp = Float64(Float64(-t) * -1.0); elseif (z <= 2.9e+132) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = fma(a, Float64(t / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.82e-84], N[((-t) * -1.0), $MachinePrecision], If[LessEqual[z, 2.9e+132], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.82 \cdot 10^{-84}:\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+132}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\end{array}
\end{array}
if z < -1.81999999999999991e-84Initial program 71.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6459.7
Applied rewrites59.7%
Taylor expanded in x around 0
Applied rewrites53.8%
Taylor expanded in z around inf
Applied rewrites48.3%
if -1.81999999999999991e-84 < z < 2.8999999999999999e132Initial program 87.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6438.7
Applied rewrites38.7%
Taylor expanded in y around inf
Applied rewrites31.4%
if 2.8999999999999999e132 < z Initial program 49.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around inf
Applied rewrites76.4%
Taylor expanded in x around 0
Applied rewrites69.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e-205) (not (<= z 1.96e-13))) (* (- t) -1.0) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e-205) || !(z <= 1.96e-13)) {
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 <= (-3.4d-205)) .or. (.not. (z <= 1.96d-13))) 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 <= -3.4e-205) || !(z <= 1.96e-13)) {
tmp = -t * -1.0;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e-205) or not (z <= 1.96e-13): tmp = -t * -1.0 else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e-205) || !(z <= 1.96e-13)) 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 <= -3.4e-205) || ~((z <= 1.96e-13))) tmp = -t * -1.0; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e-205], N[Not[LessEqual[z, 1.96e-13]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-205} \lor \neg \left(z \leq 1.96 \cdot 10^{-13}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.4000000000000002e-205 or 1.95999999999999998e-13 < z Initial program 69.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.4
Applied rewrites50.4%
Taylor expanded in x around 0
Applied rewrites47.2%
Taylor expanded in z around inf
Applied rewrites42.6%
if -3.4000000000000002e-205 < z < 1.95999999999999998e-13Initial program 91.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
Applied rewrites30.2%
Applied rewrites34.2%
Final simplification39.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.4e-205) (fma a (/ t z) t) (if (<= z 1.96e-13) (* t (/ y a)) (* (- t) -1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e-205) {
tmp = fma(a, (t / z), t);
} else if (z <= 1.96e-13) {
tmp = t * (y / a);
} else {
tmp = -t * -1.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.4e-205) tmp = fma(a, Float64(t / z), t); elseif (z <= 1.96e-13) tmp = Float64(t * Float64(y / a)); else tmp = Float64(Float64(-t) * -1.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.4e-205], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 1.96e-13], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[((-t) * -1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-205}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{elif}\;z \leq 1.96 \cdot 10^{-13}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot -1\\
\end{array}
\end{array}
if z < -3.4000000000000002e-205Initial program 76.3%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6456.8
Applied rewrites56.8%
Taylor expanded in z around inf
Applied rewrites46.0%
Taylor expanded in x around 0
Applied rewrites40.4%
if -3.4000000000000002e-205 < z < 1.95999999999999998e-13Initial program 91.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6439.1
Applied rewrites39.1%
Taylor expanded in z around 0
Applied rewrites30.2%
Applied rewrites34.2%
if 1.95999999999999998e-13 < z Initial program 60.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6441.2
Applied rewrites41.2%
Taylor expanded in x around 0
Applied rewrites50.4%
Taylor expanded in z around inf
Applied rewrites46.5%
(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 76.7%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6448.2
Applied rewrites48.2%
Taylor expanded in x around 0
Applied rewrites35.3%
Taylor expanded in z around inf
Applied rewrites31.2%
(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 76.7%
Taylor expanded in z around inf
lower--.f6422.9
Applied rewrites22.9%
(FPCore (x y z t a) :precision binary64 (+ x (- x)))
double code(double x, double y, double z, double t, double a) {
return x + -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 + -x
end function
public static double code(double x, double y, double z, double t, double a) {
return x + -x;
}
def code(x, y, z, t, a): return x + -x
function code(x, y, z, t, a) return Float64(x + Float64(-x)) end
function tmp = code(x, y, z, t, a) tmp = x + -x; end
code[x_, y_, z_, t_, a_] := N[(x + (-x)), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-x\right)
\end{array}
Initial program 76.7%
Taylor expanded in z around inf
lower--.f6422.9
Applied rewrites22.9%
Taylor expanded in x around inf
Applied rewrites2.8%
herbie shell --seed 2024359
(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)))))