
(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 17 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 (if (<= t -2.9e+178) (+ (- (- (* (fma x (/ (- z a) (* t y)) (- (/ (- z a) t))) y))) y) (fma (- y x) (/ (- z t) (- a t)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.9e+178) {
tmp = -(-(fma(x, ((z - a) / (t * y)), -((z - a) / t)) * y)) + y;
} else {
tmp = fma((y - x), ((z - t) / (a - t)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.9e+178) tmp = Float64(Float64(-Float64(-Float64(fma(x, Float64(Float64(z - a) / Float64(t * y)), Float64(-Float64(Float64(z - a) / t))) * y))) + y); else tmp = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.9e+178], N[((-(-N[(N[(x * N[(N[(z - a), $MachinePrecision] / N[(t * y), $MachinePrecision]), $MachinePrecision] + (-N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision] * y), $MachinePrecision])) + y), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+178}:\\
\;\;\;\;\left(-\left(-\mathsf{fma}\left(x, \frac{z - a}{t \cdot y}, -\frac{z - a}{t}\right) \cdot y\right)\right) + y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\end{array}
\end{array}
if t < -2.9e178Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.4%
if -2.9e178 < t Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.2e+144) (- y (* (/ (- y x) t) z)) (fma (- y x) (/ (- z t) (- a t)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e+144) {
tmp = y - (((y - x) / t) * z);
} else {
tmp = fma((y - x), ((z - t) / (a - t)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.2e+144) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * z)); else tmp = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.2e+144], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+144}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\end{array}
\end{array}
if t < -3.2000000000000001e144Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
if -3.2000000000000001e144 < t Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.7e+77)
(- y (* (/ (- y x) t) z))
(if (<= t 5.4e+30)
(fma (- y x) (/ z (- a t)) x)
(+ (- (/ (* (- y x) (- z a)) t)) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e+77) {
tmp = y - (((y - x) / t) * z);
} else if (t <= 5.4e+30) {
tmp = fma((y - x), (z / (a - t)), x);
} else {
tmp = -(((y - x) * (z - a)) / t) + y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e+77) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * z)); elseif (t <= 5.4e+30) tmp = fma(Float64(y - x), Float64(z / Float64(a - t)), x); else tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e+77], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e+30], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+77}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot z\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\end{array}
\end{array}
if t < -1.69999999999999998e77Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
if -1.69999999999999998e77 < t < 5.3999999999999997e30Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6461.2
Applied rewrites61.2%
if 5.3999999999999997e30 < t Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (* (/ (- y x) t) z))))
(if (<= t -1.7e+77)
t_1
(if (<= t 6.2e+30) (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 <= -1.7e+77) {
tmp = t_1;
} else if (t <= 6.2e+30) {
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 <= -1.7e+77) tmp = t_1; elseif (t <= 6.2e+30) 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, -1.7e+77], t$95$1, If[LessEqual[t, 6.2e+30], 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 -1.7 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.69999999999999998e77 or 6.1999999999999995e30 < t Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
if -1.69999999999999998e77 < t < 6.1999999999999995e30Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f6461.2
Applied rewrites61.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -6.2e-144)
(fma (- y x) (/ (- z t) a) x)
(if (<= a 1.4e-6)
(+ (- (/ (* (- y x) z) t)) y)
(fma y (/ (- z t) (- a t)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.2e-144) {
tmp = fma((y - x), ((z - t) / a), x);
} else if (a <= 1.4e-6) {
tmp = -(((y - x) * z) / t) + y;
} else {
tmp = fma(y, ((z - t) / (a - t)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.2e-144) tmp = fma(Float64(y - x), Float64(Float64(z - t) / a), x); elseif (a <= 1.4e-6) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * z) / t)) + y); else tmp = fma(y, Float64(Float64(z - t) / Float64(a - t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.2e-144], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.4e-6], N[((-N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{-144}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-6}:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot z}{t}\right) + y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)\\
\end{array}
\end{array}
if a < -6.2000000000000001e-144Initial program 68.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
if -6.2000000000000001e-144 < a < 1.39999999999999994e-6Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6443.2
Applied rewrites43.2%
if 1.39999999999999994e-6 < a Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
Taylor expanded in x around 0
Applied rewrites67.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- z t) a) x)))
(if (<= a -6.2e-144)
t_1
(if (<= a 9.6e-8) (+ (- (/ (* (- y x) z) 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), x);
double tmp;
if (a <= -6.2e-144) {
tmp = t_1;
} else if (a <= 9.6e-8) {
tmp = -(((y - x) * z) / 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) / a), x) tmp = 0.0 if (a <= -6.2e-144) tmp = t_1; elseif (a <= 9.6e-8) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * z) / 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] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -6.2e-144], t$95$1, If[LessEqual[a, 9.6e-8], N[((-N[(N[(N[(y - x), $MachinePrecision] * z), $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}, x\right)\\
\mathbf{if}\;a \leq -6.2 \cdot 10^{-144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{-8}:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot z}{t}\right) + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.2000000000000001e-144 or 9.59999999999999994e-8 < a Initial program 68.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
if -6.2000000000000001e-144 < a < 9.59999999999999994e-8Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6443.2
Applied rewrites43.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- y (* (/ (- y x) t) z)))) (if (<= t -4.6e-10) t_1 (if (<= t 3.2e-8) (fma z (/ (- y x) a) 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 <= -4.6e-10) {
tmp = t_1;
} else if (t <= 3.2e-8) {
tmp = fma(z, ((y - x) / a), 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 <= -4.6e-10) tmp = t_1; elseif (t <= 3.2e-8) tmp = fma(z, Float64(Float64(y - x) / a), 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, -4.6e-10], t$95$1, If[LessEqual[t, 3.2e-8], N[(z * N[(N[(y - x), $MachinePrecision] / a), $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 -4.6 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.60000000000000014e-10 or 3.2000000000000002e-8 < t Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in a around 0
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
if -4.60000000000000014e-10 < t < 3.2000000000000002e-8Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- y (- (* (/ z t) x))))) (if (<= t -1e-18) t_1 (if (<= t 3.2e-8) (fma z (/ (- y x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - -((z / t) * x);
double tmp;
if (t <= -1e-18) {
tmp = t_1;
} else if (t <= 3.2e-8) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y - Float64(-Float64(Float64(z / t) * x))) tmp = 0.0 if (t <= -1e-18) tmp = t_1; elseif (t <= 3.2e-8) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - (-N[(N[(z / t), $MachinePrecision] * x), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[t, -1e-18], t$95$1, If[LessEqual[t, 3.2e-8], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \left(-\frac{z}{t} \cdot x\right)\\
\mathbf{if}\;t \leq -1 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.0000000000000001e-18 or 3.2000000000000002e-8 < t Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in a around 0
distribute-neg-frac2N/A
distribute-rgt-out--N/A
*-commutativeN/A
fp-cancel-sub-signN/A
distribute-neg-frac2N/A
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6440.4
Applied rewrites40.4%
if -1.0000000000000001e-18 < t < 3.2000000000000002e-8Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ y a) x))) (if (<= a -5e+16) t_1 (if (<= a 2.6e+49) (- y (- (* (/ z t) x))) 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 <= -5e+16) {
tmp = t_1;
} else if (a <= 2.6e+49) {
tmp = y - -((z / t) * x);
} 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 <= -5e+16) tmp = t_1; elseif (a <= 2.6e+49) tmp = Float64(y - Float64(-Float64(Float64(z / t) * x))); 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, -5e+16], t$95$1, If[LessEqual[a, 2.6e+49], N[(y - (-N[(N[(z / t), $MachinePrecision] * x), $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 -5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+49}:\\
\;\;\;\;y - \left(-\frac{z}{t} \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5e16 or 2.59999999999999989e49 < a Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
Applied rewrites40.1%
if -5e16 < a < 2.59999999999999989e49Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in a around 0
distribute-neg-frac2N/A
distribute-rgt-out--N/A
*-commutativeN/A
fp-cancel-sub-signN/A
distribute-neg-frac2N/A
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6440.4
Applied rewrites40.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ y a) x))) (if (<= a -6.2e-144) t_1 (if (<= a 2.6e+49) (* (- 1.0 (/ z t)) y) 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 <= -6.2e-144) {
tmp = t_1;
} else if (a <= 2.6e+49) {
tmp = (1.0 - (z / t)) * y;
} 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 <= -6.2e-144) tmp = t_1; elseif (a <= 2.6e+49) tmp = Float64(Float64(1.0 - Float64(z / t)) * y); 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, -6.2e-144], t$95$1, If[LessEqual[a, 2.6e+49], N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * y), $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 -6.2 \cdot 10^{-144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+49}:\\
\;\;\;\;\left(1 - \frac{z}{t}\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.2000000000000001e-144 or 2.59999999999999989e49 < a Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
Applied rewrites40.1%
if -6.2000000000000001e-144 < a < 2.59999999999999989e49Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in a around 0
distribute-neg-frac2N/A
distribute-rgt-out--N/A
*-commutativeN/A
fp-cancel-sub-signN/A
distribute-neg-frac2N/A
lower--.f64N/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lift-/.f6435.9
Applied rewrites35.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ y a) x))) (if (<= a -2000000000.0) t_1 (if (<= a 1.7e-5) (* (/ (- 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 <= -2000000000.0) {
tmp = t_1;
} else if (a <= 1.7e-5) {
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 <= -2000000000.0) tmp = t_1; elseif (a <= 1.7e-5) 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, -2000000000.0], t$95$1, If[LessEqual[a, 1.7e-5], 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 -2000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{x - y}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2e9 or 1.7e-5 < a Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
Applied rewrites40.1%
if -2e9 < a < 1.7e-5Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6424.8
Applied rewrites24.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e+105) (* x (/ z t)) (if (<= t 1.1e+91) (fma z (/ y a) x) (fma (- y x) 1.0 x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+105) {
tmp = x * (z / t);
} else if (t <= 1.1e+91) {
tmp = fma(z, (y / a), x);
} else {
tmp = fma((y - x), 1.0, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e+105) tmp = Float64(x * Float64(z / t)); elseif (t <= 1.1e+91) tmp = fma(z, Float64(y / a), x); else tmp = fma(Float64(y - x), 1.0, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e+105], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e+91], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * 1.0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+105}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, 1, x\right)\\
\end{array}
\end{array}
if t < -6.50000000000000049e105Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
if -6.50000000000000049e105 < t < 1.1e91Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
Applied rewrites40.1%
if 1.1e91 < t Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites19.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma t (/ x a) x)))
(if (<= a -26000000000000.0)
t_1
(if (<= a 2.35e-301)
(* x (/ z t))
(if (<= a 9.6e+54) (fma (- y x) 1.0 x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (x / a), x);
double tmp;
if (a <= -26000000000000.0) {
tmp = t_1;
} else if (a <= 2.35e-301) {
tmp = x * (z / t);
} else if (a <= 9.6e+54) {
tmp = fma((y - x), 1.0, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(x / a), x) tmp = 0.0 if (a <= -26000000000000.0) tmp = t_1; elseif (a <= 2.35e-301) tmp = Float64(x * Float64(z / t)); elseif (a <= 9.6e+54) tmp = fma(Float64(y - x), 1.0, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(x / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -26000000000000.0], t$95$1, If[LessEqual[a, 2.35e-301], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.6e+54], N[(N[(y - x), $MachinePrecision] * 1.0 + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{x}{a}, x\right)\\
\mathbf{if}\;a \leq -26000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-301}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(y - x, 1, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.6e13 or 9.59999999999999993e54 < a Initial program 68.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-/.f64N/A
lift--.f6431.8
Applied rewrites31.8%
Taylor expanded in y around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6426.5
Applied rewrites26.5%
if -2.6e13 < a < 2.3499999999999998e-301Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
if 2.3499999999999998e-301 < a < 9.59999999999999993e54Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites19.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) 1.0 x)) (t_2 (* x (/ z t))))
(if (<= x -4.8e+138)
t_2
(if (<= x -3e-263)
t_1
(if (<= x 1.75e-126) (* y (/ z a)) (if (<= x 2.05e-44) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), 1.0, x);
double t_2 = x * (z / t);
double tmp;
if (x <= -4.8e+138) {
tmp = t_2;
} else if (x <= -3e-263) {
tmp = t_1;
} else if (x <= 1.75e-126) {
tmp = y * (z / a);
} else if (x <= 2.05e-44) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), 1.0, x) t_2 = Float64(x * Float64(z / t)) tmp = 0.0 if (x <= -4.8e+138) tmp = t_2; elseif (x <= -3e-263) tmp = t_1; elseif (x <= 1.75e-126) tmp = Float64(y * Float64(z / a)); elseif (x <= 2.05e-44) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * 1.0 + x), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e+138], t$95$2, If[LessEqual[x, -3e-263], t$95$1, If[LessEqual[x, 1.75e-126], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.05e-44], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, 1, x\right)\\
t_2 := x \cdot \frac{z}{t}\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-263}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-126}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -4.8000000000000002e138 or 2.04999999999999996e-44 < x Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
if -4.8000000000000002e138 < x < -3e-263 or 1.75e-126 < x < 2.04999999999999996e-44Initial program 68.0%
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--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites19.2%
if -3e-263 < x < 1.75e-126Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6416.9
Applied rewrites16.9%
lift-*.f64N/A
*-commutativeN/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6419.4
Applied rewrites19.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* x (/ z t)))) (if (<= x -2.45e-24) t_1 (if (<= x 1.5e-59) (* z (/ y a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / t);
double tmp;
if (x <= -2.45e-24) {
tmp = t_1;
} else if (x <= 1.5e-59) {
tmp = z * (y / a);
} 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 = x * (z / t)
if (x <= (-2.45d-24)) then
tmp = t_1
else if (x <= 1.5d-59) then
tmp = z * (y / a)
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 = x * (z / t);
double tmp;
if (x <= -2.45e-24) {
tmp = t_1;
} else if (x <= 1.5e-59) {
tmp = z * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (z / t) tmp = 0 if x <= -2.45e-24: tmp = t_1 elif x <= 1.5e-59: tmp = z * (y / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(z / t)) tmp = 0.0 if (x <= -2.45e-24) tmp = t_1; elseif (x <= 1.5e-59) tmp = Float64(z * Float64(y / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (z / t); tmp = 0.0; if (x <= -2.45e-24) tmp = t_1; elseif (x <= 1.5e-59) tmp = z * (y / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.45e-24], t$95$1, If[LessEqual[x, 1.5e-59], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{t}\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-59}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.45e-24 or 1.5e-59 < x Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
if -2.45e-24 < x < 1.5e-59Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6416.9
Applied rewrites16.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* x (/ z t)))) (if (<= x -2.45e-24) t_1 (if (<= x 1.55e-59) (* y (/ z a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / t);
double tmp;
if (x <= -2.45e-24) {
tmp = t_1;
} else if (x <= 1.55e-59) {
tmp = y * (z / a);
} 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 = x * (z / t)
if (x <= (-2.45d-24)) then
tmp = t_1
else if (x <= 1.55d-59) then
tmp = y * (z / a)
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 = x * (z / t);
double tmp;
if (x <= -2.45e-24) {
tmp = t_1;
} else if (x <= 1.55e-59) {
tmp = y * (z / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (z / t) tmp = 0 if x <= -2.45e-24: tmp = t_1 elif x <= 1.55e-59: tmp = y * (z / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(z / t)) tmp = 0.0 if (x <= -2.45e-24) tmp = t_1; elseif (x <= 1.55e-59) tmp = Float64(y * Float64(z / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (z / t); tmp = 0.0; if (x <= -2.45e-24) tmp = t_1; elseif (x <= 1.55e-59) tmp = y * (z / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.45e-24], t$95$1, If[LessEqual[x, 1.55e-59], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{t}\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-59}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.45e-24 or 1.55e-59 < x Initial program 68.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
if -2.45e-24 < x < 1.55e-59Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6416.9
Applied rewrites16.9%
lift-*.f64N/A
*-commutativeN/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6419.4
Applied rewrites19.4%
(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.0%
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--.f6445.6
Applied rewrites45.6%
Taylor expanded in x around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
herbie shell --seed 2025143
(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))))