
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_1 -1e-229)
(+ x (* (- t x) (/ (- z y) (- z a))))
(if (<= t_1 0.0)
(+ t (* -1.0 (/ (- (* y (- t x)) (* a (- t x))) z)))
(+ x (/ (- t x) (/ (- a z) (- y z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_1 <= -1e-229) {
tmp = x + ((t - x) * ((z - y) / (z - a)));
} else if (t_1 <= 0.0) {
tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z));
} else {
tmp = x + ((t - x) / ((a - z) / (y - z)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - z) * (t - x)) / (a - z))
if (t_1 <= (-1d-229)) then
tmp = x + ((t - x) * ((z - y) / (z - a)))
else if (t_1 <= 0.0d0) then
tmp = t + ((-1.0d0) * (((y * (t - x)) - (a * (t - x))) / z))
else
tmp = x + ((t - x) / ((a - z) / (y - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_1 <= -1e-229) {
tmp = x + ((t - x) * ((z - y) / (z - a)));
} else if (t_1 <= 0.0) {
tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z));
} else {
tmp = x + ((t - x) / ((a - z) / (y - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) * (t - x)) / (a - z)) tmp = 0 if t_1 <= -1e-229: tmp = x + ((t - x) * ((z - y) / (z - a))) elif t_1 <= 0.0: tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z)) else: tmp = x + ((t - x) / ((a - z) / (y - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_1 <= -1e-229) tmp = Float64(x + Float64(Float64(t - x) * Float64(Float64(z - y) / Float64(z - a)))); elseif (t_1 <= 0.0) tmp = Float64(t + Float64(-1.0 * Float64(Float64(Float64(y * Float64(t - x)) - Float64(a * Float64(t - x))) / z))); else tmp = Float64(x + Float64(Float64(t - x) / Float64(Float64(a - z) / Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) * (t - x)) / (a - z)); tmp = 0.0; if (t_1 <= -1e-229) tmp = x + ((t - x) * ((z - y) / (z - a))); elseif (t_1 <= 0.0) tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z)); else tmp = x + ((t - x) / ((a - z) / (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-229], N[(x + N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t + N[(-1.0 * N[(N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - x), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-229}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{z - y}{z - a}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - x}{\frac{a - z}{y - z}}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000007e-229Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -1.00000000000000007e-229 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6483.9
Applied rewrites83.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_1 -1e-229)
(+ x (* (- t x) (/ (- z y) (- z a))))
(if (<= t_1 0.0)
(fma (* (- x t) (- y a)) (/ 1.0 z) t)
(+ x (/ (- t x) (/ (- a z) (- y z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_1 <= -1e-229) {
tmp = x + ((t - x) * ((z - y) / (z - a)));
} else if (t_1 <= 0.0) {
tmp = fma(((x - t) * (y - a)), (1.0 / z), t);
} else {
tmp = x + ((t - x) / ((a - z) / (y - z)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_1 <= -1e-229) tmp = Float64(x + Float64(Float64(t - x) * Float64(Float64(z - y) / Float64(z - a)))); elseif (t_1 <= 0.0) tmp = fma(Float64(Float64(x - t) * Float64(y - a)), Float64(1.0 / z), t); else tmp = Float64(x + Float64(Float64(t - x) / Float64(Float64(a - z) / Float64(y - z)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-229], N[(x + N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(x - t), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision] + t), $MachinePrecision], N[(x + N[(N[(t - x), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-229}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{z - y}{z - a}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\left(x - t\right) \cdot \left(y - a\right), \frac{1}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - x}{\frac{a - z}{y - z}}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000007e-229Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -1.00000000000000007e-229 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f64N/A
lower-/.f6447.5
Applied rewrites47.5%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6483.9
Applied rewrites83.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- t x) (/ (- z y) (- z a)))))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -1e-229)
t_1
(if (<= t_2 0.0) (fma (* (- x t) (- y a)) (/ 1.0 z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((t - x) * ((z - y) / (z - a)));
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -1e-229) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(((x - t) * (y - a)), (1.0 / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(t - x) * Float64(Float64(z - y) / Float64(z - a)))) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -1e-229) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(Float64(x - t) * Float64(y - a)), Float64(1.0 / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-229], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(N[(x - t), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right) \cdot \frac{z - y}{z - a}\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\left(x - t\right) \cdot \left(y - a\right), \frac{1}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000007e-229 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -1.00000000000000007e-229 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f64N/A
lower-/.f6447.5
Applied rewrites47.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- z y) (- z a)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -1e-229)
t_1
(if (<= t_2 0.0) (fma (* (- x t) (- y a)) (/ 1.0 z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((z - y) / (z - a)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -1e-229) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(((x - t) * (y - a)), (1.0 / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(z - y) / Float64(z - a)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -1e-229) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(Float64(x - t) * Float64(y - a)), Float64(1.0 / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-229], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(N[(x - t), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{z - y}{z - a}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\left(x - t\right) \cdot \left(y - a\right), \frac{1}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000007e-229 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -1.00000000000000007e-229 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f64N/A
lower-/.f6447.5
Applied rewrites47.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- z y) (- z a)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -1e-229)
t_1
(if (<= t_2 0.0) (- t (* (- t x) (/ (- y a) z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((z - y) / (z - a)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -1e-229) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t - ((t - x) * ((y - a) / z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(z - y) / Float64(z - a)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -1e-229) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t - Float64(Float64(t - x) * Float64(Float64(y - a) / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-229], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t - N[(N[(t - x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{z - y}{z - a}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000007e-229 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -1.00000000000000007e-229 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.9
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6454.2
Applied rewrites54.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.7e-49)
(+ x (/ (- t x) (/ a (- y z))))
(if (<= a 1.55e-7)
(- t (* (- t x) (/ (- y a) z)))
(fma (/ (- t x) a) (- y z) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.7e-49) {
tmp = x + ((t - x) / (a / (y - z)));
} else if (a <= 1.55e-7) {
tmp = t - ((t - x) * ((y - a) / z));
} else {
tmp = fma(((t - x) / a), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.7e-49) tmp = Float64(x + Float64(Float64(t - x) / Float64(a / Float64(y - z)))); elseif (a <= 1.55e-7) tmp = Float64(t - Float64(Float64(t - x) * Float64(Float64(y - a) / z))); else tmp = fma(Float64(Float64(t - x) / a), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.7e-49], N[(x + N[(N[(t - x), $MachinePrecision] / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e-7], N[(t - N[(N[(t - x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.7 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-7}:\\
\;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\end{array}
\end{array}
if a < -5.7000000000000003e-49Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in z around 0
Applied rewrites52.6%
if -5.7000000000000003e-49 < a < 1.55e-7Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.9
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6454.2
Applied rewrites54.2%
if 1.55e-7 < a Initial program 68.3%
Taylor expanded in z around 0
Applied rewrites46.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) (- y z) x)))
(if (<= a -5.7e-49)
t_1
(if (<= a 1.55e-7) (- t (* (- t x) (/ (- y a) z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), (y - z), x);
double tmp;
if (a <= -5.7e-49) {
tmp = t_1;
} else if (a <= 1.55e-7) {
tmp = t - ((t - x) * ((y - a) / z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), Float64(y - z), x) tmp = 0.0 if (a <= -5.7e-49) tmp = t_1; elseif (a <= 1.55e-7) tmp = Float64(t - Float64(Float64(t - x) * Float64(Float64(y - a) / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.7e-49], t$95$1, If[LessEqual[a, 1.55e-7], N[(t - N[(N[(t - x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -5.7 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-7}:\\
\;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.7000000000000003e-49 or 1.55e-7 < a Initial program 68.3%
Taylor expanded in z around 0
Applied rewrites46.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
if -5.7000000000000003e-49 < a < 1.55e-7Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.9
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6454.2
Applied rewrites54.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) (- y z) x)))
(if (<= a -2.6e+15)
t_1
(if (<= a 1.55e-292)
(* (- x t) (/ y (- z a)))
(if (<= a 9.2e-28) (* (/ (- z y) (- z a)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), (y - z), x);
double tmp;
if (a <= -2.6e+15) {
tmp = t_1;
} else if (a <= 1.55e-292) {
tmp = (x - t) * (y / (z - a));
} else if (a <= 9.2e-28) {
tmp = ((z - y) / (z - a)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), Float64(y - z), x) tmp = 0.0 if (a <= -2.6e+15) tmp = t_1; elseif (a <= 1.55e-292) tmp = Float64(Float64(x - t) * Float64(y / Float64(z - a))); elseif (a <= 9.2e-28) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.6e+15], t$95$1, If[LessEqual[a, 1.55e-292], N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.2e-28], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-292}:\\
\;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{-28}:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.6e15 or 9.19999999999999942e-28 < a Initial program 68.3%
Taylor expanded in z around 0
Applied rewrites46.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
if -2.6e15 < a < 1.55e-292Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6442.8
Applied rewrites42.8%
if 1.55e-292 < a < 9.19999999999999942e-28Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6483.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
sub-negate-revN/A
lower--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.4e-6)
(+ x (* (- t x) (/ y a)))
(if (<= a 1.55e-292)
(* (- x t) (/ y (- z a)))
(if (<= a 6e-40)
(* (/ (- z y) (- z a)) t)
(if (<= a 4.9e+34)
(* (/ (- x t) (- z a)) y)
(fma (/ t a) (- y z) x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.4e-6) {
tmp = x + ((t - x) * (y / a));
} else if (a <= 1.55e-292) {
tmp = (x - t) * (y / (z - a));
} else if (a <= 6e-40) {
tmp = ((z - y) / (z - a)) * t;
} else if (a <= 4.9e+34) {
tmp = ((x - t) / (z - a)) * y;
} else {
tmp = fma((t / a), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.4e-6) tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); elseif (a <= 1.55e-292) tmp = Float64(Float64(x - t) * Float64(y / Float64(z - a))); elseif (a <= 6e-40) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * t); elseif (a <= 4.9e+34) tmp = Float64(Float64(Float64(x - t) / Float64(z - a)) * y); else tmp = fma(Float64(t / a), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.4e-6], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e-292], N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-40], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 4.9e+34], N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.4 \cdot 10^{-6}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-292}:\\
\;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-40}:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x - t}{z - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\end{array}
\end{array}
if a < -7.4000000000000003e-6Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in z around 0
lower-/.f6448.3
Applied rewrites48.3%
if -7.4000000000000003e-6 < a < 1.55e-292Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6442.8
Applied rewrites42.8%
if 1.55e-292 < a < 6.00000000000000039e-40Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6483.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
sub-negate-revN/A
lower--.f6451.6
Applied rewrites51.6%
if 6.00000000000000039e-40 < a < 4.9000000000000003e34Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
if 4.9000000000000003e34 < a Initial program 68.3%
Taylor expanded in z around 0
Applied rewrites46.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites43.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.4e-6)
(fma (/ y a) (- t x) x)
(if (<= a 1.55e-292)
(* (- x t) (/ y (- z a)))
(if (<= a 6e-40)
(* (/ (- z y) (- z a)) t)
(if (<= a 4.9e+34)
(* (/ (- x t) (- z a)) y)
(fma (/ t a) (- y z) x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.4e-6) {
tmp = fma((y / a), (t - x), x);
} else if (a <= 1.55e-292) {
tmp = (x - t) * (y / (z - a));
} else if (a <= 6e-40) {
tmp = ((z - y) / (z - a)) * t;
} else if (a <= 4.9e+34) {
tmp = ((x - t) / (z - a)) * y;
} else {
tmp = fma((t / a), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.4e-6) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (a <= 1.55e-292) tmp = Float64(Float64(x - t) * Float64(y / Float64(z - a))); elseif (a <= 6e-40) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * t); elseif (a <= 4.9e+34) tmp = Float64(Float64(Float64(x - t) / Float64(z - a)) * y); else tmp = fma(Float64(t / a), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.4e-6], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.55e-292], N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-40], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 4.9e+34], N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.4 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-292}:\\
\;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-40}:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x - t}{z - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\end{array}
\end{array}
if a < -7.4000000000000003e-6Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6483.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in z around 0
lower-/.f6448.3
Applied rewrites48.3%
if -7.4000000000000003e-6 < a < 1.55e-292Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6442.8
Applied rewrites42.8%
if 1.55e-292 < a < 6.00000000000000039e-40Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6483.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.6
Applied rewrites39.6%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
sub-negate-revN/A
lower--.f6451.6
Applied rewrites51.6%
if 6.00000000000000039e-40 < a < 4.9000000000000003e34Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
if 4.9000000000000003e34 < a Initial program 68.3%
Taylor expanded in z around 0
Applied rewrites46.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites43.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.4e-6) (fma (/ y a) (- t x) x) (if (<= a 4.9e+34) (* (- x t) (/ y (- z a))) (fma (/ t a) (- y z) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.4e-6) {
tmp = fma((y / a), (t - x), x);
} else if (a <= 4.9e+34) {
tmp = (x - t) * (y / (z - a));
} else {
tmp = fma((t / a), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.4e-6) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (a <= 4.9e+34) tmp = Float64(Float64(x - t) * Float64(y / Float64(z - a))); else tmp = fma(Float64(t / a), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.4e-6], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 4.9e+34], N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.4 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{+34}:\\
\;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\end{array}
\end{array}
if a < -7.4000000000000003e-6Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6483.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in z around 0
lower-/.f6448.3
Applied rewrites48.3%
if -7.4000000000000003e-6 < a < 4.9000000000000003e34Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6442.8
Applied rewrites42.8%
if 4.9000000000000003e34 < a Initial program 68.3%
Taylor expanded in z around 0
Applied rewrites46.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites43.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y a) (- t x) x)))
(if (<= a -9.5e-10)
t_1
(if (<= a -3.4e-173)
(/ (* x y) (- z a))
(if (<= a -7e-247)
(+ x (- t x))
(if (<= a 8.4e-13) (* (/ (- x t) z) y) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / a), (t - x), x);
double tmp;
if (a <= -9.5e-10) {
tmp = t_1;
} else if (a <= -3.4e-173) {
tmp = (x * y) / (z - a);
} else if (a <= -7e-247) {
tmp = x + (t - x);
} else if (a <= 8.4e-13) {
tmp = ((x - t) / z) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / a), Float64(t - x), x) tmp = 0.0 if (a <= -9.5e-10) tmp = t_1; elseif (a <= -3.4e-173) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (a <= -7e-247) tmp = Float64(x + Float64(t - x)); elseif (a <= 8.4e-13) tmp = Float64(Float64(Float64(x - t) / z) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -9.5e-10], t$95$1, If[LessEqual[a, -3.4e-173], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7e-247], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.4e-13], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-173}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;a \leq -7 \cdot 10^{-247}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;a \leq 8.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.50000000000000028e-10 or 8.39999999999999955e-13 < a Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6483.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6483.9
Applied rewrites83.9%
Taylor expanded in z around 0
lower-/.f6448.3
Applied rewrites48.3%
if -9.50000000000000028e-10 < a < -3.3999999999999999e-173Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if -3.3999999999999999e-173 < a < -6.9999999999999998e-247Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
if -6.9999999999999998e-247 < a < 8.39999999999999955e-13Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6425.3
Applied rewrites25.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- x t) z) y))) (if (<= y -4.4e+119) t_1 (if (<= y 3e+74) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - t) / z) * y;
double tmp;
if (y <= -4.4e+119) {
tmp = t_1;
} else if (y <= 3e+74) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((x - t) / z) * y
if (y <= (-4.4d+119)) then
tmp = t_1
else if (y <= 3d+74) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - t) / z) * y;
double tmp;
if (y <= -4.4e+119) {
tmp = t_1;
} else if (y <= 3e+74) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - t) / z) * y tmp = 0 if y <= -4.4e+119: tmp = t_1 elif y <= 3e+74: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - t) / z) * y) tmp = 0.0 if (y <= -4.4e+119) tmp = t_1; elseif (y <= 3e+74) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - t) / z) * y; tmp = 0.0; if (y <= -4.4e+119) tmp = t_1; elseif (y <= 3e+74) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4.4e+119], t$95$1, If[LessEqual[y, 3e+74], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - t}{z} \cdot y\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+74}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.4000000000000003e119 or 3e74 < y Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6425.3
Applied rewrites25.3%
if -4.4000000000000003e119 < y < 3e74Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.1e+121) (/ (* x y) (- z a)) (if (<= y 3.2e+126) (+ x t) (* y (/ (- t x) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+121) {
tmp = (x * y) / (z - a);
} else if (y <= 3.2e+126) {
tmp = x + t;
} else {
tmp = y * ((t - x) / a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.1d+121)) then
tmp = (x * y) / (z - a)
else if (y <= 3.2d+126) then
tmp = x + t
else
tmp = y * ((t - x) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+121) {
tmp = (x * y) / (z - a);
} else if (y <= 3.2e+126) {
tmp = x + t;
} else {
tmp = y * ((t - x) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e+121: tmp = (x * y) / (z - a) elif y <= 3.2e+126: tmp = x + t else: tmp = y * ((t - x) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e+121) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (y <= 3.2e+126) tmp = Float64(x + t); else tmp = Float64(y * Float64(Float64(t - x) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.1e+121) tmp = (x * y) / (z - a); elseif (y <= 3.2e+126) tmp = x + t; else tmp = y * ((t - x) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+121], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+126], N[(x + t), $MachinePrecision], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+121}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+126}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\
\end{array}
\end{array}
if y < -3.10000000000000008e121Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if -3.10000000000000008e121 < y < 3.1999999999999998e126Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 3.1999999999999998e126 < y Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6425.6
Applied rewrites25.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.1e+121) (/ (* x y) (- z a)) (if (<= y 1.25e+77) (+ x t) (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+121) {
tmp = (x * y) / (z - a);
} else if (y <= 1.25e+77) {
tmp = x + t;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.1d+121)) then
tmp = (x * y) / (z - a)
else if (y <= 1.25d+77) then
tmp = x + t
else
tmp = y * (t / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+121) {
tmp = (x * y) / (z - a);
} else if (y <= 1.25e+77) {
tmp = x + t;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e+121: tmp = (x * y) / (z - a) elif y <= 1.25e+77: tmp = x + t else: tmp = y * (t / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e+121) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (y <= 1.25e+77) tmp = Float64(x + t); else tmp = Float64(y * Float64(t / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.1e+121) tmp = (x * y) / (z - a); elseif (y <= 1.25e+77) tmp = x + t; else tmp = y * (t / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+121], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+77], N[(x + t), $MachinePrecision], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+121}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+77}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if y < -3.10000000000000008e121Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if -3.10000000000000008e121 < y < 1.25000000000000001e77Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 1.25000000000000001e77 < y Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6422.6
Applied rewrites22.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.1e+121) (/ (* x y) (- z a)) (if (<= y 1.25e+77) (+ x t) (/ (* t y) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+121) {
tmp = (x * y) / (z - a);
} else if (y <= 1.25e+77) {
tmp = x + t;
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.1d+121)) then
tmp = (x * y) / (z - a)
else if (y <= 1.25d+77) then
tmp = x + t
else
tmp = (t * y) / (a - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+121) {
tmp = (x * y) / (z - a);
} else if (y <= 1.25e+77) {
tmp = x + t;
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e+121: tmp = (x * y) / (z - a) elif y <= 1.25e+77: tmp = x + t else: tmp = (t * y) / (a - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e+121) tmp = Float64(Float64(x * y) / Float64(z - a)); elseif (y <= 1.25e+77) tmp = Float64(x + t); else tmp = Float64(Float64(t * y) / Float64(a - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.1e+121) tmp = (x * y) / (z - a); elseif (y <= 1.25e+77) tmp = x + t; else tmp = (t * y) / (a - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+121], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+77], N[(x + t), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+121}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+77}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\end{array}
\end{array}
if y < -3.10000000000000008e121Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.0
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6441.3
Applied rewrites41.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if -3.10000000000000008e121 < y < 1.25000000000000001e77Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 1.25000000000000001e77 < y Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.8
Applied rewrites20.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.4e+128) (/ (* x y) z) (if (<= y 1.25e+77) (+ x t) (/ (* t y) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.4e+128) {
tmp = (x * y) / z;
} else if (y <= 1.25e+77) {
tmp = x + t;
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.4d+128)) then
tmp = (x * y) / z
else if (y <= 1.25d+77) then
tmp = x + t
else
tmp = (t * y) / (a - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.4e+128) {
tmp = (x * y) / z;
} else if (y <= 1.25e+77) {
tmp = x + t;
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.4e+128: tmp = (x * y) / z elif y <= 1.25e+77: tmp = x + t else: tmp = (t * y) / (a - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.4e+128) tmp = Float64(Float64(x * y) / z); elseif (y <= 1.25e+77) tmp = Float64(x + t); else tmp = Float64(Float64(t * y) / Float64(a - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.4e+128) tmp = (x * y) / z; elseif (y <= 1.25e+77) tmp = x + t; else tmp = (t * y) / (a - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.4e+128], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 1.25e+77], N[(x + t), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+128}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+77}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\end{array}
\end{array}
if y < -3.3999999999999999e128Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in y around inf
lower-*.f6416.7
Applied rewrites16.7%
if -3.3999999999999999e128 < y < 1.25000000000000001e77Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 1.25000000000000001e77 < y Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.8
Applied rewrites20.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.4e+128) (/ (* x y) z) (if (<= y 2.9e+128) (+ x t) (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.4e+128) {
tmp = (x * y) / z;
} else if (y <= 2.9e+128) {
tmp = x + t;
} else {
tmp = y * (t / a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.4d+128)) then
tmp = (x * y) / z
else if (y <= 2.9d+128) then
tmp = x + t
else
tmp = y * (t / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.4e+128) {
tmp = (x * y) / z;
} else if (y <= 2.9e+128) {
tmp = x + t;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.4e+128: tmp = (x * y) / z elif y <= 2.9e+128: tmp = x + t else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.4e+128) tmp = Float64(Float64(x * y) / z); elseif (y <= 2.9e+128) tmp = Float64(x + t); else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.4e+128) tmp = (x * y) / z; elseif (y <= 2.9e+128) tmp = x + t; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.4e+128], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.9e+128], N[(x + t), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+128}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+128}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if y < -3.3999999999999999e128Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in y around inf
lower-*.f6416.7
Applied rewrites16.7%
if -3.3999999999999999e128 < y < 2.9e128Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
if 2.9e128 < y Initial program 68.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.0
Applied rewrites41.0%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f64N/A
lower-/.f6425.0
Applied rewrites25.0%
Taylor expanded in x around 0
lower-/.f6417.5
Applied rewrites17.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* x y) z))) (if (<= y -3.4e+128) t_1 (if (<= y 6.8e+128) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (y <= -3.4e+128) {
tmp = t_1;
} else if (y <= 6.8e+128) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) / z
if (y <= (-3.4d+128)) then
tmp = t_1
else if (y <= 6.8d+128) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (y <= -3.4e+128) {
tmp = t_1;
} else if (y <= 6.8e+128) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / z tmp = 0 if y <= -3.4e+128: tmp = t_1 elif y <= 6.8e+128: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / z) tmp = 0.0 if (y <= -3.4e+128) tmp = t_1; elseif (y <= 6.8e+128) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) / z; tmp = 0.0; if (y <= -3.4e+128) tmp = t_1; elseif (y <= 6.8e+128) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -3.4e+128], t$95$1, If[LessEqual[y, 6.8e+128], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{z}\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+128}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.3999999999999999e128 or 6.7999999999999997e128 < y Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in y around inf
lower-*.f6416.7
Applied rewrites16.7%
if -3.3999999999999999e128 < y < 6.7999999999999997e128Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + 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 + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}
\\
x + t
\end{array}
Initial program 68.3%
Taylor expanded in z around inf
lower--.f6420.2
Applied rewrites20.2%
Taylor expanded in x around 0
Applied rewrites35.4%
herbie shell --seed 2025156
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y z) (- t x)) (- a z))))