
(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}
Herbie found 18 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 -4e-71)
t_2
(if (<= t_3 4e-108)
(*
(- x)
(-
(fma (/ (/ (* (- y z) t) x) (- a z)) -1.0 (/ y (- a z)))
(+ (/ z (- a z)) 1.0)))
t_2))))
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 <= -4e-71) {
tmp = t_2;
} else if (t_3 <= 4e-108) {
tmp = -x * (fma(((((y - z) * t) / x) / (a - z)), -1.0, (y / (a - z))) - ((z / (a - z)) + 1.0));
} else {
tmp = t_2;
}
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 <= -4e-71) tmp = t_2; elseif (t_3 <= 4e-108) tmp = Float64(Float64(-x) * Float64(fma(Float64(Float64(Float64(Float64(y - z) * t) / x) / Float64(a - z)), -1.0, Float64(y / Float64(a - z))) - Float64(Float64(z / Float64(a - z)) + 1.0))); else tmp = t_2; 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, -4e-71], t$95$2, If[LessEqual[t$95$3, 4e-108], N[((-x) * N[(N[(N[(N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\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 -4 \cdot 10^{-71}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{-108}:\\
\;\;\;\;\left(-x\right) \cdot \left(\mathsf{fma}\left(\frac{\frac{\left(y - z\right) \cdot t}{x}}{a - z}, -1, \frac{y}{a - z}\right) - \left(\frac{z}{a - z} + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.9999999999999997e-71 or 4.00000000000000016e-108 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 93.4%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6493.4
Applied rewrites93.4%
if -3.9999999999999997e-71 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000016e-108Initial program 37.7%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites70.9%
(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 -5e-203)
t_2
(if (<= t_3 2e-252) (fma (/ (* (- t x) (- y a)) z) -1.0 t) t_2))))
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 <= -5e-203) {
tmp = t_2;
} else if (t_3 <= 2e-252) {
tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
} else {
tmp = t_2;
}
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 <= -5e-203) tmp = t_2; elseif (t_3 <= 2e-252) tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t); else tmp = t_2; 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, -5e-203], t$95$2, If[LessEqual[t$95$3, 2e-252], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], t$95$2]]]]]
\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 -5 \cdot 10^{-203}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-252}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000002e-203 or 1.99999999999999989e-252 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6491.7
Applied rewrites91.7%
if -5.0000000000000002e-203 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999989e-252Initial program 14.1%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites73.3%
(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 -5e-203)
t_2
(if (<= t_3 2e-252) (fma (/ (* (- t x) y) z) -1.0 t) t_2))))
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 <= -5e-203) {
tmp = t_2;
} else if (t_3 <= 2e-252) {
tmp = fma((((t - x) * y) / z), -1.0, t);
} else {
tmp = t_2;
}
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 <= -5e-203) tmp = t_2; elseif (t_3 <= 2e-252) tmp = fma(Float64(Float64(Float64(t - x) * y) / z), -1.0, t); else tmp = t_2; 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, -5e-203], t$95$2, If[LessEqual[t$95$3, 2e-252], N[(N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], t$95$2]]]]]
\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 -5 \cdot 10^{-203}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-252}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot y}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000002e-203 or 1.99999999999999989e-252 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6491.7
Applied rewrites91.7%
if -5.0000000000000002e-203 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999989e-252Initial program 14.1%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites73.3%
Taylor expanded in y around inf
Applied rewrites53.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))) (if (<= t_1 -5e-203) (+ x t) (if (<= t_1 0.0) t (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -5e-203) {
tmp = x + t;
} else if (t_1 <= 0.0) {
tmp = t;
} else {
tmp = x + t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * ((t - x) / (a - z)))
if (t_1 <= (-5d-203)) then
tmp = x + t
else if (t_1 <= 0.0d0) then
tmp = t
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -5e-203) {
tmp = x + t;
} else if (t_1 <= 0.0) {
tmp = t;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -5e-203: tmp = x + t elif t_1 <= 0.0: tmp = t else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -5e-203) tmp = Float64(x + t); elseif (t_1 <= 0.0) tmp = t; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -5e-203) tmp = x + t; elseif (t_1 <= 0.0) tmp = t; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-203], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 0.0], t, N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-203}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000002e-203 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.1%
Taylor expanded in z around inf
lift--.f6421.2
Applied rewrites21.2%
Taylor expanded in x around 0
Applied rewrites38.3%
if -5.0000000000000002e-203 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 11.3%
Taylor expanded in z around inf
Applied rewrites34.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* t (/ z (- a z))))))
(if (<= z -4.8e+136)
t_1
(if (<= z -9e-242)
(fma (/ (- t x) (- a z)) y x)
(if (<= z 8e+152) (fma (- t x) (/ (- y z) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(t * (z / (a - z)));
double tmp;
if (z <= -4.8e+136) {
tmp = t_1;
} else if (z <= -9e-242) {
tmp = fma(((t - x) / (a - z)), y, x);
} else if (z <= 8e+152) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-Float64(t * Float64(z / Float64(a - z)))) tmp = 0.0 if (z <= -4.8e+136) tmp = t_1; elseif (z <= -9e-242) tmp = fma(Float64(Float64(t - x) / Float64(a - z)), y, x); elseif (z <= 8e+152) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[z, -4.8e+136], t$95$1, If[LessEqual[z, -9e-242], N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 8e+152], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -t \cdot \frac{z}{a - z}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-242}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a - z}, y, x\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.8000000000000001e136 or 8.0000000000000004e152 < z Initial program 57.9%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6436.4
Applied rewrites36.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6461.7
Applied rewrites61.7%
if -4.8000000000000001e136 < z < -8.9999999999999997e-242Initial program 86.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6486.8
Applied rewrites86.8%
Taylor expanded in y around inf
Applied rewrites70.8%
if -8.9999999999999997e-242 < z < 8.0000000000000004e152Initial program 88.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6470.6
Applied rewrites70.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -4.2e-85)
t_1
(if (<= a -7.8e-296)
(/ (* (- t x) y) (- a z))
(if (<= a 1.65e-37) (/ (* (- y z) t) (- a z)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -4.2e-85) {
tmp = t_1;
} else if (a <= -7.8e-296) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 1.65e-37) {
tmp = ((y - z) * t) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -4.2e-85) tmp = t_1; elseif (a <= -7.8e-296) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 1.65e-37) tmp = Float64(Float64(Float64(y - z) * t) / Float64(a - z)); 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 - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -4.2e-85], t$95$1, If[LessEqual[a, -7.8e-296], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e-37], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-37}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.2e-85 or 1.64999999999999991e-37 < a Initial program 86.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6470.7
Applied rewrites70.7%
if -4.2e-85 < a < -7.80000000000000021e-296Initial program 69.6%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6454.4
Applied rewrites54.4%
if -7.80000000000000021e-296 < a < 1.64999999999999991e-37Initial program 71.9%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6450.9
Applied rewrites50.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ y a) x)))
(if (<= a -150000000.0)
t_1
(if (<= a -7.8e-296)
(/ (* (- t x) y) (- a z))
(if (<= a 2.8e-37) (/ (* (- y z) t) (- a z)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), (y / a), x);
double tmp;
if (a <= -150000000.0) {
tmp = t_1;
} else if (a <= -7.8e-296) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 2.8e-37) {
tmp = ((y - z) * t) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(y / a), x) tmp = 0.0 if (a <= -150000000.0) tmp = t_1; elseif (a <= -7.8e-296) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 2.8e-37) tmp = Float64(Float64(Float64(y - z) * t) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -150000000.0], t$95$1, If[LessEqual[a, -7.8e-296], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-37], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -150000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-37}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.5e8 or 2.8000000000000001e-37 < a Initial program 87.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6474.0
Applied rewrites74.0%
Taylor expanded in y around inf
Applied rewrites66.0%
if -1.5e8 < a < -7.80000000000000021e-296Initial program 71.9%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6452.4
Applied rewrites52.4%
if -7.80000000000000021e-296 < a < 2.8000000000000001e-37Initial program 71.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6450.8
Applied rewrites50.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* t (/ z (- a z))))))
(if (<= z -3.8e+159)
t_1
(if (<= z -9.8e-25)
(* (- y z) (/ t (- a z)))
(if (<= z 8e+152) (fma (- t x) (/ y a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(t * (z / (a - z)));
double tmp;
if (z <= -3.8e+159) {
tmp = t_1;
} else if (z <= -9.8e-25) {
tmp = (y - z) * (t / (a - z));
} else if (z <= 8e+152) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-Float64(t * Float64(z / Float64(a - z)))) tmp = 0.0 if (z <= -3.8e+159) tmp = t_1; elseif (z <= -9.8e-25) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z))); elseif (z <= 8e+152) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[z, -3.8e+159], t$95$1, If[LessEqual[z, -9.8e-25], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+152], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -t \cdot \frac{z}{a - z}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{-25}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.79999999999999965e159 or 8.0000000000000004e152 < z Initial program 57.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6436.3
Applied rewrites36.3%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6463.0
Applied rewrites63.0%
if -3.79999999999999965e159 < z < -9.7999999999999998e-25Initial program 80.2%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6443.2
Applied rewrites43.2%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6449.5
Applied rewrites49.5%
if -9.7999999999999998e-25 < z < 8.0000000000000004e152Initial program 89.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6471.5
Applied rewrites71.5%
Taylor expanded in y around inf
Applied rewrites67.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.3e-31)
(fma (- t x) (/ (- y z) a) x)
(if (<= a 5e-71)
(fma (/ (* (- t x) y) z) -1.0 t)
(+ x (* (- y z) (/ t (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.3e-31) {
tmp = fma((t - x), ((y - z) / a), x);
} else if (a <= 5e-71) {
tmp = fma((((t - x) * y) / z), -1.0, t);
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.3e-31) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); elseif (a <= 5e-71) tmp = fma(Float64(Float64(Float64(t - x) * y) / z), -1.0, t); else tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.3e-31], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 5e-71], N[(N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-71}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot y}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if a < -3.2999999999999999e-31Initial program 86.7%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6473.4
Applied rewrites73.4%
if -3.2999999999999999e-31 < a < 4.99999999999999998e-71Initial program 71.1%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.8%
Taylor expanded in y around inf
Applied rewrites72.9%
if 4.99999999999999998e-71 < a Initial program 85.7%
Taylor expanded in x around 0
Applied rewrites73.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -3.3e-31)
t_1
(if (<= a 3.4e-65) (fma (/ (* (- t x) y) z) -1.0 t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -3.3e-31) {
tmp = t_1;
} else if (a <= 3.4e-65) {
tmp = fma((((t - x) * y) / z), -1.0, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -3.3e-31) tmp = t_1; elseif (a <= 3.4e-65) tmp = fma(Float64(Float64(Float64(t - x) * y) / z), -1.0, t); 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 - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.3e-31], t$95$1, If[LessEqual[a, 3.4e-65], N[(N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -3.3 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-65}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot y}{z}, -1, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.2999999999999999e-31 or 3.39999999999999987e-65 < a Initial program 86.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6471.6
Applied rewrites71.6%
if -3.2999999999999999e-31 < a < 3.39999999999999987e-65Initial program 71.2%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.7%
Taylor expanded in y around inf
Applied rewrites72.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (* t (/ z (- a z)))))) (if (<= z -4.8e+136) t_1 (if (<= z 8e+152) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(t * (z / (a - z)));
double tmp;
if (z <= -4.8e+136) {
tmp = t_1;
} else if (z <= 8e+152) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-Float64(t * Float64(z / Float64(a - z)))) tmp = 0.0 if (z <= -4.8e+136) tmp = t_1; elseif (z <= 8e+152) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[z, -4.8e+136], t$95$1, If[LessEqual[z, 8e+152], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -t \cdot \frac{z}{a - z}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.8000000000000001e136 or 8.0000000000000004e152 < z Initial program 57.9%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6436.4
Applied rewrites36.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6461.7
Applied rewrites61.7%
if -4.8000000000000001e136 < z < 8.0000000000000004e152Initial program 87.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.0
Applied rewrites67.0%
Taylor expanded in y around inf
Applied rewrites61.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.8e+136) t (if (<= z 8e+152) (fma (- t x) (/ y a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+136) {
tmp = t;
} else if (z <= 8e+152) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+136) tmp = t; elseif (z <= 8e+152) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+136], t, If[LessEqual[z, 8e+152], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -4.8000000000000001e136 or 8.0000000000000004e152 < z Initial program 57.9%
Taylor expanded in z around inf
Applied rewrites57.0%
if -4.8000000000000001e136 < z < 8.0000000000000004e152Initial program 87.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.0
Applied rewrites67.0%
Taylor expanded in y around inf
Applied rewrites61.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.8e+136) t (if (<= z 8e+152) (fma y (/ (- t x) a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+136) {
tmp = t;
} else if (z <= 8e+152) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+136) tmp = t; elseif (z <= 8e+152) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+136], t, If[LessEqual[z, 8e+152], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -4.8000000000000001e136 or 8.0000000000000004e152 < z Initial program 57.9%
Taylor expanded in z around inf
Applied rewrites57.0%
if -4.8000000000000001e136 < z < 8.0000000000000004e152Initial program 87.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6460.6
Applied rewrites60.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.8e+136) t (if (<= z 1.6e+36) (fma y (/ t a) x) (if (<= z 1.9e+192) (+ x t) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+136) {
tmp = t;
} else if (z <= 1.6e+36) {
tmp = fma(y, (t / a), x);
} else if (z <= 1.9e+192) {
tmp = x + t;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+136) tmp = t; elseif (z <= 1.6e+36) tmp = fma(y, Float64(t / a), x); elseif (z <= 1.9e+192) tmp = Float64(x + t); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+136], t, If[LessEqual[z, 1.6e+36], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.9e+192], N[(x + t), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+136}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+192}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -4.8000000000000001e136 or 1.9e192 < z Initial program 55.9%
Taylor expanded in z around inf
Applied rewrites58.6%
if -4.8000000000000001e136 < z < 1.5999999999999999e36Initial program 89.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.9
Applied rewrites64.9%
Taylor expanded in x around 0
Applied rewrites54.0%
if 1.5999999999999999e36 < z < 1.9e192Initial program 77.1%
Taylor expanded in z around inf
lift--.f6426.3
Applied rewrites26.3%
Taylor expanded in x around 0
Applied rewrites38.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.2e+209) (* t (/ y a)) (if (<= y 1.2e+101) (+ x t) (* x (/ y z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.2e+209) {
tmp = t * (y / a);
} else if (y <= 1.2e+101) {
tmp = x + t;
} else {
tmp = x * (y / z);
}
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 (y <= (-4.2d+209)) then
tmp = t * (y / a)
else if (y <= 1.2d+101) then
tmp = x + t
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.2e+209) {
tmp = t * (y / a);
} else if (y <= 1.2e+101) {
tmp = x + t;
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.2e+209: tmp = t * (y / a) elif y <= 1.2e+101: tmp = x + t else: tmp = x * (y / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.2e+209) tmp = Float64(t * Float64(y / a)); elseif (y <= 1.2e+101) tmp = Float64(x + t); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.2e+209) tmp = t * (y / a); elseif (y <= 1.2e+101) tmp = x + t; else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.2e+209], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+101], N[(x + t), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+209}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+101}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -4.2e209Initial program 91.9%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites60.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift--.f6443.7
Applied rewrites43.7%
Taylor expanded in z around 0
lower-/.f6439.0
Applied rewrites39.0%
if -4.2e209 < y < 1.19999999999999994e101Initial program 76.6%
Taylor expanded in z around inf
lift--.f6422.6
Applied rewrites22.6%
Taylor expanded in x around 0
Applied rewrites40.4%
if 1.19999999999999994e101 < y Initial program 90.3%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.0%
Taylor expanded in x around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6432.4
Applied rewrites32.4%
Taylor expanded in y around inf
Applied rewrites32.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (/ y a)))) (if (<= y -4.2e+209) t_1 (if (<= y 7.8e+96) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (y <= -4.2e+209) {
tmp = t_1;
} else if (y <= 7.8e+96) {
tmp = x + t;
} 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 = t * (y / a)
if (y <= (-4.2d+209)) then
tmp = t_1
else if (y <= 7.8d+96) then
tmp = x + t
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 = t * (y / a);
double tmp;
if (y <= -4.2e+209) {
tmp = t_1;
} else if (y <= 7.8e+96) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if y <= -4.2e+209: tmp = t_1 elif y <= 7.8e+96: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) tmp = 0.0 if (y <= -4.2e+209) tmp = t_1; elseif (y <= 7.8e+96) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / a); tmp = 0.0; if (y <= -4.2e+209) tmp = t_1; elseif (y <= 7.8e+96) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.2e+209], t$95$1, If[LessEqual[y, 7.8e+96], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+96}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.2e209 or 7.8e96 < y Initial program 90.7%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites64.0%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift--.f6444.3
Applied rewrites44.3%
Taylor expanded in z around 0
lower-/.f6435.5
Applied rewrites35.5%
if -4.2e209 < y < 7.8e96Initial program 76.6%
Taylor expanded in z around inf
lift--.f6422.6
Applied rewrites22.6%
Taylor expanded in x around 0
Applied rewrites40.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.6e-25) t (if (<= z 3.7e+36) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-25) {
tmp = t;
} else if (z <= 3.7e+36) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.6d-25)) then
tmp = t
else if (z <= 3.7d+36) then
tmp = x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-25) {
tmp = t;
} else if (z <= 3.7e+36) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e-25: tmp = t elif z <= 3.7e+36: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e-25) tmp = t; elseif (z <= 3.7e+36) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.6e-25) tmp = t; elseif (z <= 3.7e+36) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e-25], t, If[LessEqual[z, 3.7e+36], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-25}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+36}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -2.6e-25 or 3.70000000000000029e36 < z Initial program 68.7%
Taylor expanded in z around inf
Applied rewrites42.4%
if -2.6e-25 < z < 3.70000000000000029e36Initial program 91.1%
Taylor expanded in a around inf
Applied rewrites34.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 80.0%
Taylor expanded in z around inf
Applied rewrites25.1%
herbie shell --seed 2025089
(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)))))