
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - 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 = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - 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 = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (fma (/ (- x y) t) z y) (- (* a (/ (- y x) t))))))
(if (<= t -7e+113)
t_1
(if (<= t 5e+207) (fma (- y x) (/ (- z t) (- a t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), z, y) - -(a * ((y - x) / t));
double tmp;
if (t <= -7e+113) {
tmp = t_1;
} else if (t <= 5e+207) {
tmp = fma((y - x), ((z - t) / (a - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(fma(Float64(Float64(x - y) / t), z, y) - Float64(-Float64(a * Float64(Float64(y - x) / t)))) tmp = 0.0 if (t <= -7e+113) tmp = t_1; elseif (t <= 5e+207) tmp = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision] - (-N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[t, -7e+113], t$95$1, If[LessEqual[t, 5e+207], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, z, y\right) - \left(-a \cdot \frac{y - x}{t}\right)\\
\mathbf{if}\;t \leq -7 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+207}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.0000000000000001e113 or 4.9999999999999999e207 < t Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6448.8
Applied rewrites48.8%
if -7.0000000000000001e113 < t < 4.9999999999999999e207Initial program 68.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.2
Applied rewrites84.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- z t) (- a t)) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -1e-290)
t_1
(if (<= t_2 0.0) (+ (- (/ (* (- y x) (- z a)) t)) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((z - t) / (a - t)), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -1e-290) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -1e-290) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-290], t$95$1, If[LessEqual[t$95$2, 0.0], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-290}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.0000000000000001e-290 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 68.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.2
Applied rewrites84.2%
if -1.0000000000000001e-290 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (* (/ (- y x) t) z))))
(if (<= t -2.8e+144)
t_1
(if (<= t 4.5e-115)
(fma (- y x) (/ z (- a t)) x)
(if (<= t 3.8e+62) (+ x (/ (* y (- z t)) (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - (((y - x) / t) * z);
double tmp;
if (t <= -2.8e+144) {
tmp = t_1;
} else if (t <= 4.5e-115) {
tmp = fma((y - x), (z / (a - t)), x);
} else if (t <= 3.8e+62) {
tmp = x + ((y * (z - t)) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y - Float64(Float64(Float64(y - x) / t) * z)) tmp = 0.0 if (t <= -2.8e+144) tmp = t_1; elseif (t <= 4.5e-115) tmp = fma(Float64(y - x), Float64(z / Float64(a - t)), x); elseif (t <= 3.8e+62) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e+144], t$95$1, If[LessEqual[t, 4.5e-115], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 3.8e+62], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{y - x}{t} \cdot z\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-115}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a - t}, x\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+62}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.80000000000000007e144 or 3.79999999999999984e62 < t Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
if -2.80000000000000007e144 < t < 4.50000000000000023e-115Initial program 68.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6461.7
Applied rewrites61.7%
if 4.50000000000000023e-115 < t < 3.79999999999999984e62Initial program 68.1%
Taylor expanded in x around 0
Applied rewrites56.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (* (/ (- y x) t) z))))
(if (<= t -2.8e+144)
t_1
(if (<= t 4.0) (fma (- y x) (/ z (- a t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - (((y - x) / t) * z);
double tmp;
if (t <= -2.8e+144) {
tmp = t_1;
} else if (t <= 4.0) {
tmp = fma((y - x), (z / (a - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y - Float64(Float64(Float64(y - x) / t) * z)) tmp = 0.0 if (t <= -2.8e+144) tmp = t_1; elseif (t <= 4.0) tmp = fma(Float64(y - x), Float64(z / Float64(a - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e+144], t$95$1, If[LessEqual[t, 4.0], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{y - x}{t} \cdot z\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.80000000000000007e144 or 4 < t Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
if -2.80000000000000007e144 < t < 4Initial program 68.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6461.7
Applied rewrites61.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y x) (/ (- z t) a) x))) (if (<= a -6.5e-46) t_1 (if (<= a 3.8e-19) (- y (* (/ (- y x) t) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((z - t) / a), x);
double tmp;
if (a <= -6.5e-46) {
tmp = t_1;
} else if (a <= 3.8e-19) {
tmp = y - (((y - x) / t) * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(z - t) / a), x) tmp = 0.0 if (a <= -6.5e-46) tmp = t_1; elseif (a <= 3.8e-19) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -6.5e-46], t$95$1, If[LessEqual[a, 3.8e-19], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{if}\;a \leq -6.5 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-19}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.49999999999999966e-46 or 3.8e-19 < a Initial program 68.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6454.1
Applied rewrites54.1%
if -6.49999999999999966e-46 < a < 3.8e-19Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.05e-17) (+ (* (/ (- z t) a) y) x) (if (<= a 1.25e+41) (- y (* (/ (- y x) t) z)) (fma z (/ (- y x) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e-17) {
tmp = (((z - t) / a) * y) + x;
} else if (a <= 1.25e+41) {
tmp = y - (((y - x) / t) * z);
} else {
tmp = fma(z, ((y - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e-17) tmp = Float64(Float64(Float64(Float64(z - t) / a) * y) + x); elseif (a <= 1.25e+41) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * z)); else tmp = fma(z, Float64(Float64(y - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e-17], N[(N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.25e+41], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{-17}:\\
\;\;\;\;\frac{z - t}{a} \cdot y + x\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+41}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.05e-17Initial program 68.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6454.1
Applied rewrites54.1%
Taylor expanded in x around 0
Applied rewrites46.2%
lift-fma.f64N/A
lower-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6446.2
Applied rewrites46.2%
if -2.05e-17 < a < 1.25000000000000006e41Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
if 1.25000000000000006e41 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.05e-17) (fma y (/ (- z t) a) x) (if (<= a 1.25e+41) (- y (* (/ (- y x) t) z)) (fma z (/ (- y x) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e-17) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= 1.25e+41) {
tmp = y - (((y - x) / t) * z);
} else {
tmp = fma(z, ((y - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e-17) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= 1.25e+41) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * z)); else tmp = fma(z, Float64(Float64(y - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e-17], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.25e+41], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+41}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.05e-17Initial program 68.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6454.1
Applied rewrites54.1%
Taylor expanded in x around 0
Applied rewrites46.2%
if -2.05e-17 < a < 1.25000000000000006e41Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6447.5
Applied rewrites47.5%
if 1.25000000000000006e41 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.3e-46)
(fma y (/ (- z t) a) x)
(if (<= a -6e-164)
(* (- z a) (/ x t))
(if (<= a 9e-41) (- y (/ (* z y) t)) (fma z (/ (- y x) a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.3e-46) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= -6e-164) {
tmp = (z - a) * (x / t);
} else if (a <= 9e-41) {
tmp = y - ((z * y) / t);
} else {
tmp = fma(z, ((y - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.3e-46) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= -6e-164) tmp = Float64(Float64(z - a) * Float64(x / t)); elseif (a <= 9e-41) tmp = Float64(y - Float64(Float64(z * y) / t)); else tmp = fma(z, Float64(Float64(y - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.3e-46], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -6e-164], N[(N[(z - a), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e-41], N[(y - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-164}:\\
\;\;\;\;\left(z - a\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-41}:\\
\;\;\;\;y - \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\end{array}
\end{array}
if a < -3.30000000000000013e-46Initial program 68.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6454.1
Applied rewrites54.1%
Taylor expanded in x around 0
Applied rewrites46.2%
if -3.30000000000000013e-46 < a < -6.0000000000000002e-164Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6419.5
Applied rewrites19.5%
flip--19.5
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f6421.3
Applied rewrites21.3%
if -6.0000000000000002e-164 < a < 9e-41Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6432.5
Applied rewrites32.5%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lift-*.f6433.7
Applied rewrites33.7%
if 9e-41 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma z (/ (- y x) a) x)))
(if (<= a -3.5e-46)
t_1
(if (<= a -6e-164)
(* (- z a) (/ x t))
(if (<= a 9e-41) (- y (/ (* z y) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, ((y - x) / a), x);
double tmp;
if (a <= -3.5e-46) {
tmp = t_1;
} else if (a <= -6e-164) {
tmp = (z - a) * (x / t);
} else if (a <= 9e-41) {
tmp = y - ((z * y) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(Float64(y - x) / a), x) tmp = 0.0 if (a <= -3.5e-46) tmp = t_1; elseif (a <= -6e-164) tmp = Float64(Float64(z - a) * Float64(x / t)); elseif (a <= 9e-41) tmp = Float64(y - Float64(Float64(z * y) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.5e-46], t$95$1, If[LessEqual[a, -6e-164], N[(N[(z - a), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e-41], N[(y - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{if}\;a \leq -3.5 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-164}:\\
\;\;\;\;\left(z - a\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-41}:\\
\;\;\;\;y - \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.5000000000000002e-46 or 9e-41 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
if -3.5000000000000002e-46 < a < -6.0000000000000002e-164Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6419.5
Applied rewrites19.5%
flip--19.5
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f6421.3
Applied rewrites21.3%
if -6.0000000000000002e-164 < a < 9e-41Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6432.5
Applied rewrites32.5%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lift-*.f6433.7
Applied rewrites33.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma z (/ y a) x)))
(if (<= a -3.5e-46)
t_1
(if (<= a -6e-164)
(* (- z a) (/ x t))
(if (<= a 7.5e+40) (- y (/ (* z y) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, (y / a), x);
double tmp;
if (a <= -3.5e-46) {
tmp = t_1;
} else if (a <= -6e-164) {
tmp = (z - a) * (x / t);
} else if (a <= 7.5e+40) {
tmp = y - ((z * y) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(y / a), x) tmp = 0.0 if (a <= -3.5e-46) tmp = t_1; elseif (a <= -6e-164) tmp = Float64(Float64(z - a) * Float64(x / t)); elseif (a <= 7.5e+40) tmp = Float64(y - Float64(Float64(z * y) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.5e-46], t$95$1, If[LessEqual[a, -6e-164], N[(N[(z - a), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e+40], N[(y - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -3.5 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-164}:\\
\;\;\;\;\left(z - a\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+40}:\\
\;\;\;\;y - \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.5000000000000002e-46 or 7.4999999999999996e40 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
Taylor expanded in x around 0
Applied rewrites40.6%
if -3.5000000000000002e-46 < a < -6.0000000000000002e-164Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6419.5
Applied rewrites19.5%
flip--19.5
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f6421.3
Applied rewrites21.3%
if -6.0000000000000002e-164 < a < 7.4999999999999996e40Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6432.5
Applied rewrites32.5%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lift-*.f6433.7
Applied rewrites33.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma z (/ y a) x)))
(if (<= a -3.5e-46)
t_1
(if (<= a -6e-164)
(* x (/ (- z a) t))
(if (<= a 7.5e+40) (- y (/ (* z y) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, (y / a), x);
double tmp;
if (a <= -3.5e-46) {
tmp = t_1;
} else if (a <= -6e-164) {
tmp = x * ((z - a) / t);
} else if (a <= 7.5e+40) {
tmp = y - ((z * y) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(y / a), x) tmp = 0.0 if (a <= -3.5e-46) tmp = t_1; elseif (a <= -6e-164) tmp = Float64(x * Float64(Float64(z - a) / t)); elseif (a <= 7.5e+40) tmp = Float64(y - Float64(Float64(z * y) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.5e-46], t$95$1, If[LessEqual[a, -6e-164], N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e+40], N[(y - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -3.5 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-164}:\\
\;\;\;\;x \cdot \frac{z - a}{t}\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+40}:\\
\;\;\;\;y - \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.5000000000000002e-46 or 7.4999999999999996e40 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
Taylor expanded in x around 0
Applied rewrites40.6%
if -3.5000000000000002e-46 < a < -6.0000000000000002e-164Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6419.5
Applied rewrites19.5%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6422.6
Applied rewrites22.6%
if -6.0000000000000002e-164 < a < 7.4999999999999996e40Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6432.5
Applied rewrites32.5%
Taylor expanded in z around inf
lower-/.f64N/A
*-commutativeN/A
lift-*.f6433.7
Applied rewrites33.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ y a) x))) (if (<= a -4e-46) t_1 (if (<= a 8e+44) (* (/ (- x y) t) z) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, (y / a), x);
double tmp;
if (a <= -4e-46) {
tmp = t_1;
} else if (a <= 8e+44) {
tmp = ((x - y) / t) * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(y / a), x) tmp = 0.0 if (a <= -4e-46) tmp = t_1; elseif (a <= 8e+44) tmp = Float64(Float64(Float64(x - y) / t) * z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -4e-46], t$95$1, If[LessEqual[a, 8e+44], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -4 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+44}:\\
\;\;\;\;\frac{x - y}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.00000000000000009e-46 or 8.0000000000000007e44 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
Taylor expanded in x around 0
Applied rewrites40.6%
if -4.00000000000000009e-46 < a < 8.0000000000000007e44Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6425.3
Applied rewrites25.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y x) 1.0 x))) (if (<= t -1.6e+176) t_1 (if (<= t 2.7e+113) (fma z (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), 1.0, x);
double tmp;
if (t <= -1.6e+176) {
tmp = t_1;
} else if (t <= 2.7e+113) {
tmp = fma(z, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), 1.0, x) tmp = 0.0 if (t <= -1.6e+176) tmp = t_1; elseif (t <= 2.7e+113) tmp = fma(z, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * 1.0 + x), $MachinePrecision]}, If[LessEqual[t, -1.6e+176], t$95$1, If[LessEqual[t, 2.7e+113], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, 1, x\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+113}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5999999999999999e176 or 2.70000000000000011e113 < t Initial program 68.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.2
Applied rewrites84.2%
Taylor expanded in t around inf
Applied rewrites19.3%
if -1.5999999999999999e176 < t < 2.70000000000000011e113Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
Taylor expanded in x around 0
Applied rewrites40.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) 1.0 x)))
(if (<= t -2.8e+166)
t_1
(if (<= t -7e-15) (* x (/ z t)) (if (<= t 0.94) (* y (/ z a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), 1.0, x);
double tmp;
if (t <= -2.8e+166) {
tmp = t_1;
} else if (t <= -7e-15) {
tmp = x * (z / t);
} else if (t <= 0.94) {
tmp = y * (z / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), 1.0, x) tmp = 0.0 if (t <= -2.8e+166) tmp = t_1; elseif (t <= -7e-15) tmp = Float64(x * Float64(z / t)); elseif (t <= 0.94) tmp = Float64(y * Float64(z / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * 1.0 + x), $MachinePrecision]}, If[LessEqual[t, -2.8e+166], t$95$1, If[LessEqual[t, -7e-15], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.94], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, 1, x\right)\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 0.94:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.79999999999999996e166 or 0.93999999999999995 < t Initial program 68.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.2
Applied rewrites84.2%
Taylor expanded in t around inf
Applied rewrites19.3%
if -2.79999999999999996e166 < t < -7.0000000000000001e-15Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6419.5
Applied rewrites19.5%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.6
Applied rewrites18.6%
if -7.0000000000000001e-15 < t < 0.93999999999999995Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-*.f64N/A
*-commutativeN/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6419.2
Applied rewrites19.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ z a)))) (if (<= y -1.9e-92) t_1 (if (<= y 5.2e-20) (* x (/ z t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (y <= -1.9e-92) {
tmp = t_1;
} else if (y <= 5.2e-20) {
tmp = x * (z / 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 = y * (z / a)
if (y <= (-1.9d-92)) then
tmp = t_1
else if (y <= 5.2d-20) then
tmp = x * (z / 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 = y * (z / a);
double tmp;
if (y <= -1.9e-92) {
tmp = t_1;
} else if (y <= 5.2e-20) {
tmp = x * (z / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / a) tmp = 0 if y <= -1.9e-92: tmp = t_1 elif y <= 5.2e-20: tmp = x * (z / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / a)) tmp = 0.0 if (y <= -1.9e-92) tmp = t_1; elseif (y <= 5.2e-20) tmp = Float64(x * Float64(z / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / a); tmp = 0.0; if (y <= -1.9e-92) tmp = t_1; elseif (y <= 5.2e-20) tmp = x * (z / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e-92], t$95$1, If[LessEqual[y, 5.2e-20], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-20}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.9e-92 or 5.1999999999999999e-20 < y Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6448.6
Applied rewrites48.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-*.f64N/A
*-commutativeN/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6419.2
Applied rewrites19.2%
if -1.9e-92 < y < 5.1999999999999999e-20Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6419.5
Applied rewrites19.5%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.6
Applied rewrites18.6%
(FPCore (x y z t a) :precision binary64 (* x (/ z t)))
double code(double x, double y, double z, double t, double a) {
return x * (z / 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 = x * (z / t)
end function
public static double code(double x, double y, double z, double t, double a) {
return x * (z / t);
}
def code(x, y, z, t, a): return x * (z / t)
function code(x, y, z, t, a) return Float64(x * Float64(z / t)) end
function tmp = code(x, y, z, t, a) tmp = x * (z / t); end
code[x_, y_, z_, t_, a_] := N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{z}{t}
\end{array}
Initial program 68.1%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6419.5
Applied rewrites19.5%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.6
Applied rewrites18.6%
herbie shell --seed 2025139
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y x) (- z t)) (- a t))))