
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
(if (<= t_2 -2e-83)
t_2
(if (<= t_2 -5e-254)
(*
(- x)
(-
(fma (/ (/ (* (- y z) t) x) (- a z)) -1.0 (/ y (- a z)))
(+ (/ z (- a z)) 1.0)))
(if (<= t_2 5e-260)
(*
-1.0
(*
x
(fma
-1.0
(/ t x)
(* -1.0 (/ (- (+ y (* -1.0 (/ (- (* t y) (* a t)) x))) a) z)))))
(if (<= t_2 1e+305)
(fma t_1 (- y z) x)
(/ (* (- t x) y) (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = x + ((y - z) * t_1);
double tmp;
if (t_2 <= -2e-83) {
tmp = t_2;
} else if (t_2 <= -5e-254) {
tmp = -x * (fma(((((y - z) * t) / x) / (a - z)), -1.0, (y / (a - z))) - ((z / (a - z)) + 1.0));
} else if (t_2 <= 5e-260) {
tmp = -1.0 * (x * fma(-1.0, (t / x), (-1.0 * (((y + (-1.0 * (((t * y) - (a * t)) / x))) - a) / z))));
} else if (t_2 <= 1e+305) {
tmp = fma(t_1, (y - z), x);
} else {
tmp = ((t - x) * y) / (a - z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_2 <= -2e-83) tmp = t_2; elseif (t_2 <= -5e-254) tmp = Float64(Float64(-x) * Float64(fma(Float64(Float64(Float64(Float64(y - z) * t) / x) / Float64(a - z)), -1.0, Float64(y / Float64(a - z))) - Float64(Float64(z / Float64(a - z)) + 1.0))); elseif (t_2 <= 5e-260) tmp = Float64(-1.0 * Float64(x * fma(-1.0, Float64(t / x), Float64(-1.0 * Float64(Float64(Float64(y + Float64(-1.0 * Float64(Float64(Float64(t * y) - Float64(a * t)) / x))) - a) / z))))); elseif (t_2 <= 1e+305) tmp = fma(t_1, Float64(y - z), x); else tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-83], t$95$2, If[LessEqual[t$95$2, -5e-254], N[((-x) * N[(N[(N[(N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-260], N[(-1.0 * N[(x * N[(-1.0 * N[(t / x), $MachinePrecision] + N[(-1.0 * N[(N[(N[(y + N[(-1.0 * N[(N[(N[(t * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-83}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;\left(-x\right) \cdot \left(\mathsf{fma}\left(\frac{\frac{\left(y - z\right) \cdot t}{x}}{a - z}, -1, \frac{y}{a - z}\right) - \left(\frac{z}{a - z} + 1\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-260}:\\
\;\;\;\;-1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \frac{t}{x}, -1 \cdot \frac{\left(y + -1 \cdot \frac{t \cdot y - a \cdot t}{x}\right) - a}{z}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.0000000000000001e-83Initial program 93.3%
if -2.0000000000000001e-83 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000003e-254Initial program 76.6%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites85.1%
if -5.0000000000000003e-254 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e-260Initial program 9.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6410.4
Applied rewrites10.4%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites70.3%
Taylor expanded in z around -inf
lower-fma.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites85.4%
if 5.0000000000000003e-260 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999994e304Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6492.8
Applied rewrites92.8%
if 9.9999999999999994e304 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 86.7%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6488.7
Applied rewrites88.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- t x) y) (- a z)))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_3 (fma (/ t (- a z)) (- y z) x)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-254)
t_3
(if (<= t_2 5e-260)
(* (/ (- y a) z) x)
(if (<= t_2 1e+305) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) * y) / (a - z);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = fma((t / (a - z)), (y - z), x);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-254) {
tmp = t_3;
} else if (t_2 <= 5e-260) {
tmp = ((y - a) / z) * x;
} else if (t_2 <= 1e+305) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - x) * y) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_3 = fma(Float64(t / Float64(a - z)), Float64(y - z), x) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-254) tmp = t_3; elseif (t_2 <= 5e-260) tmp = Float64(Float64(Float64(y - a) / z) * x); elseif (t_2 <= 1e+305) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-254], t$95$3, If[LessEqual[t$95$2, 5e-260], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(t - x\right) \cdot y}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_3 := \mathsf{fma}\left(\frac{t}{a - z}, y - z, x\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-260}:\\
\;\;\;\;\frac{y - a}{z} \cdot x\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 9.9999999999999994e304 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 85.5%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6489.4
Applied rewrites89.4%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000003e-254 or 5.0000000000000003e-260 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999994e304Initial program 92.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6492.7
Applied rewrites92.7%
Taylor expanded in x around 0
Applied rewrites78.1%
if -5.0000000000000003e-254 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e-260Initial program 9.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f649.2
Applied rewrites9.2%
Taylor expanded in z around -inf
lower-/.f64N/A
lower--.f6452.7
Applied rewrites52.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
(if (<= t_2 -5e-254)
t_2
(if (<= t_2 5e-260)
(*
-1.0
(*
x
(fma
-1.0
(/ t x)
(* -1.0 (/ (- (+ y (* -1.0 (/ (- (* t y) (* a t)) x))) a) z)))))
(if (<= t_2 1e+305) (fma t_1 (- y z) x) (/ (* (- t x) y) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = x + ((y - z) * t_1);
double tmp;
if (t_2 <= -5e-254) {
tmp = t_2;
} else if (t_2 <= 5e-260) {
tmp = -1.0 * (x * fma(-1.0, (t / x), (-1.0 * (((y + (-1.0 * (((t * y) - (a * t)) / x))) - a) / z))));
} else if (t_2 <= 1e+305) {
tmp = fma(t_1, (y - z), x);
} else {
tmp = ((t - x) * y) / (a - z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_2 <= -5e-254) tmp = t_2; elseif (t_2 <= 5e-260) tmp = Float64(-1.0 * Float64(x * fma(-1.0, Float64(t / x), Float64(-1.0 * Float64(Float64(Float64(y + Float64(-1.0 * Float64(Float64(Float64(t * y) - Float64(a * t)) / x))) - a) / z))))); elseif (t_2 <= 1e+305) tmp = fma(t_1, Float64(y - z), x); else tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-254], t$95$2, If[LessEqual[t$95$2, 5e-260], N[(-1.0 * N[(x * N[(-1.0 * N[(t / x), $MachinePrecision] + N[(-1.0 * N[(N[(N[(y + N[(-1.0 * N[(N[(N[(t * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-260}:\\
\;\;\;\;-1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \frac{t}{x}, -1 \cdot \frac{\left(y + -1 \cdot \frac{t \cdot y - a \cdot t}{x}\right) - a}{z}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000003e-254Initial program 91.1%
if -5.0000000000000003e-254 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e-260Initial program 9.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6410.4
Applied rewrites10.4%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites70.3%
Taylor expanded in z around -inf
lower-fma.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites85.4%
if 5.0000000000000003e-260 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999994e304Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6492.8
Applied rewrites92.8%
if 9.9999999999999994e304 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 86.7%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6488.7
Applied rewrites88.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
(if (<= t_2 -5e-254)
t_2
(if (<= t_2 5e-260)
(fma (/ (* (- t x) (- y a)) z) -1.0 t)
(if (<= t_2 1e+305) (fma t_1 (- y z) x) (/ (* (- t x) y) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = x + ((y - z) * t_1);
double tmp;
if (t_2 <= -5e-254) {
tmp = t_2;
} else if (t_2 <= 5e-260) {
tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
} else if (t_2 <= 1e+305) {
tmp = fma(t_1, (y - z), x);
} else {
tmp = ((t - x) * y) / (a - z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_2 <= -5e-254) tmp = t_2; elseif (t_2 <= 5e-260) tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t); elseif (t_2 <= 1e+305) tmp = fma(t_1, Float64(y - z), x); else tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-254], t$95$2, If[LessEqual[t$95$2, 5e-260], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-260}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000003e-254Initial program 91.1%
if -5.0000000000000003e-254 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e-260Initial program 9.8%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites78.1%
if 5.0000000000000003e-260 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999994e304Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6492.8
Applied rewrites92.8%
if 9.9999999999999994e304 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 86.7%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6488.7
Applied rewrites88.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z)))
(t_2 (fma t_1 (- y z) x))
(t_3 (+ x (* (- y z) t_1))))
(if (<= t_3 -5e-254)
t_2
(if (<= t_3 5e-260)
(fma (/ (* (- t x) (- y a)) z) -1.0 t)
(if (<= t_3 1e+305) t_2 (/ (* (- t x) y) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = fma(t_1, (y - z), x);
double t_3 = x + ((y - z) * t_1);
double tmp;
if (t_3 <= -5e-254) {
tmp = t_2;
} else if (t_3 <= 5e-260) {
tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
} else if (t_3 <= 1e+305) {
tmp = t_2;
} else {
tmp = ((t - x) * y) / (a - z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = fma(t_1, Float64(y - z), x) t_3 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_3 <= -5e-254) tmp = t_2; elseif (t_3 <= 5e-260) tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t); elseif (t_3 <= 1e+305) tmp = t_2; else tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-254], t$95$2, If[LessEqual[t$95$3, 5e-260], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision], If[LessEqual[t$95$3, 1e+305], t$95$2, N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(t\_1, y - z, x\right)\\
t_3 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-260}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+305}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000003e-254 or 5.0000000000000003e-260 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999994e304Initial program 91.9%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6491.9
Applied rewrites91.9%
if -5.0000000000000003e-254 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e-260Initial program 9.8%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites78.1%
if 9.9999999999999994e304 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 86.7%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6488.7
Applied rewrites88.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z)))
(t_2 (fma t_1 (- y z) x))
(t_3 (+ x (* (- y z) t_1))))
(if (<= t_3 -5e-254)
t_2
(if (<= t_3 2e-276)
(* (/ (- y a) z) x)
(if (<= t_3 1e+305) t_2 (/ (* (- t x) y) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = fma(t_1, (y - z), x);
double t_3 = x + ((y - z) * t_1);
double tmp;
if (t_3 <= -5e-254) {
tmp = t_2;
} else if (t_3 <= 2e-276) {
tmp = ((y - a) / z) * x;
} else if (t_3 <= 1e+305) {
tmp = t_2;
} else {
tmp = ((t - x) * y) / (a - z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / Float64(a - z)) t_2 = fma(t_1, Float64(y - z), x) t_3 = Float64(x + Float64(Float64(y - z) * t_1)) tmp = 0.0 if (t_3 <= -5e-254) tmp = t_2; elseif (t_3 <= 2e-276) tmp = Float64(Float64(Float64(y - a) / z) * x); elseif (t_3 <= 1e+305) tmp = t_2; else tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-254], t$95$2, If[LessEqual[t$95$3, 2e-276], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$3, 1e+305], t$95$2, N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := \mathsf{fma}\left(t\_1, y - z, x\right)\\
t_3 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-276}:\\
\;\;\;\;\frac{y - a}{z} \cdot x\\
\mathbf{elif}\;t\_3 \leq 10^{+305}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000003e-254 or 2e-276 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999994e304Initial program 91.6%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6491.6
Applied rewrites91.6%
if -5.0000000000000003e-254 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-276Initial program 8.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f648.5
Applied rewrites8.5%
Taylor expanded in z around -inf
lower-/.f64N/A
lower--.f6454.1
Applied rewrites54.1%
if 9.9999999999999994e304 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 86.7%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6488.7
Applied rewrites88.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1
(*
-1.0
(*
x
(-
(fma -1.0 (* (/ t x) (/ (- y z) (- a z))) (/ y (- a z)))
(+ 1.0 (/ z (- a z))))))))
(if (<= x -2.45e-156)
t_1
(if (<= x 4.4e-94) (+ x (* (- y z) (/ (- t x) (- a z)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -1.0 * (x * (fma(-1.0, ((t / x) * ((y - z) / (a - z))), (y / (a - z))) - (1.0 + (z / (a - z)))));
double tmp;
if (x <= -2.45e-156) {
tmp = t_1;
} else if (x <= 4.4e-94) {
tmp = x + ((y - z) * ((t - x) / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-1.0 * Float64(x * Float64(fma(-1.0, Float64(Float64(t / x) * Float64(Float64(y - z) / Float64(a - z))), Float64(y / Float64(a - z))) - Float64(1.0 + Float64(z / Float64(a - z)))))) tmp = 0.0 if (x <= -2.45e-156) tmp = t_1; elseif (x <= 4.4e-94) tmp = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-1.0 * N[(x * N[(N[(-1.0 * N[(N[(t / x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.45e-156], t$95$1, If[LessEqual[x, 4.4e-94], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(x \cdot \left(\mathsf{fma}\left(-1, \frac{t}{x} \cdot \frac{y - z}{a - z}, \frac{y}{a - z}\right) - \left(1 + \frac{z}{a - z}\right)\right)\right)\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{-156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-94}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.44999999999999976e-156 or 4.40000000000000002e-94 < x Initial program 77.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6477.1
Applied rewrites77.1%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.3%
if -2.44999999999999976e-156 < x < 4.40000000000000002e-94Initial program 86.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+120)
t
(if (<= z -1.8e-43)
(fma (/ t a) (- y z) x)
(if (<= z 4.3e-134)
(fma y (/ (- t x) a) x)
(if (<= z 7e+155) (fma (/ t (- a z)) y x) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+120) {
tmp = t;
} else if (z <= -1.8e-43) {
tmp = fma((t / a), (y - z), x);
} else if (z <= 4.3e-134) {
tmp = fma(y, ((t - x) / a), x);
} else if (z <= 7e+155) {
tmp = fma((t / (a - z)), y, x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+120) tmp = t; elseif (z <= -1.8e-43) tmp = fma(Float64(t / a), Float64(y - z), x); elseif (z <= 4.3e-134) tmp = fma(y, Float64(Float64(t - x) / a), x); elseif (z <= 7e+155) tmp = fma(Float64(t / Float64(a - z)), y, x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+120], t, If[LessEqual[z, -1.8e-43], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4.3e-134], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 7e+155], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+120}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-134}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -6e120 or 6.99999999999999969e155 < z Initial program 58.1%
Taylor expanded in z around inf
Applied rewrites55.3%
if -6e120 < z < -1.7999999999999999e-43Initial program 84.5%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6484.7
Applied rewrites84.7%
Taylor expanded in x around 0
Applied rewrites64.3%
Taylor expanded in z around 0
Applied rewrites41.5%
if -1.7999999999999999e-43 < z < 4.29999999999999987e-134Initial program 92.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6478.7
Applied rewrites78.7%
if 4.29999999999999987e-134 < z < 6.99999999999999969e155Initial program 84.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6484.4
Applied rewrites84.4%
Taylor expanded in x around 0
Applied rewrites68.6%
Taylor expanded in y around inf
Applied rewrites47.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+120)
t
(if (<= z -1.8e-43)
(fma (/ t a) (- y z) x)
(if (<= z 6.5e+155) (fma y (/ (- t x) a) x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+120) {
tmp = t;
} else if (z <= -1.8e-43) {
tmp = fma((t / a), (y - z), x);
} else if (z <= 6.5e+155) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+120) tmp = t; elseif (z <= -1.8e-43) tmp = fma(Float64(t / a), Float64(y - z), x); elseif (z <= 6.5e+155) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+120], t, If[LessEqual[z, -1.8e-43], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 6.5e+155], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+120}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -6e120 or 6.50000000000000046e155 < z Initial program 58.1%
Taylor expanded in z around inf
Applied rewrites55.3%
if -6e120 < z < -1.7999999999999999e-43Initial program 84.5%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6484.7
Applied rewrites84.7%
Taylor expanded in x around 0
Applied rewrites64.3%
Taylor expanded in z around 0
Applied rewrites41.5%
if -1.7999999999999999e-43 < z < 6.50000000000000046e155Initial program 88.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.6
Applied rewrites64.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -3.2e+59)
t_1
(if (<= z 2.4e-66) (fma (- t x) (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (z <= -3.2e+59) {
tmp = t_1;
} else if (z <= 2.4e-66) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (z <= -3.2e+59) tmp = t_1; elseif (z <= 2.4e-66) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+59], t$95$1, If[LessEqual[z, 2.4e-66], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-66}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.19999999999999982e59 or 2.40000000000000026e-66 < z Initial program 69.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6469.1
Applied rewrites69.1%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6460.9
Applied rewrites60.9%
if -3.19999999999999982e59 < z < 2.40000000000000026e-66Initial program 91.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6477.1
Applied rewrites77.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -8.4e+124)
x
(if (<= a -1.95e-118)
t
(if (<= a -4e-294) (* (/ y z) x) (if (<= a 1.62e+122) t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.4e+124) {
tmp = x;
} else if (a <= -1.95e-118) {
tmp = t;
} else if (a <= -4e-294) {
tmp = (y / z) * x;
} else if (a <= 1.62e+122) {
tmp = t;
} else {
tmp = x;
}
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 (a <= (-8.4d+124)) then
tmp = x
else if (a <= (-1.95d-118)) then
tmp = t
else if (a <= (-4d-294)) then
tmp = (y / z) * x
else if (a <= 1.62d+122) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.4e+124) {
tmp = x;
} else if (a <= -1.95e-118) {
tmp = t;
} else if (a <= -4e-294) {
tmp = (y / z) * x;
} else if (a <= 1.62e+122) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.4e+124: tmp = x elif a <= -1.95e-118: tmp = t elif a <= -4e-294: tmp = (y / z) * x elif a <= 1.62e+122: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.4e+124) tmp = x; elseif (a <= -1.95e-118) tmp = t; elseif (a <= -4e-294) tmp = Float64(Float64(y / z) * x); elseif (a <= 1.62e+122) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.4e+124) tmp = x; elseif (a <= -1.95e-118) tmp = t; elseif (a <= -4e-294) tmp = (y / z) * x; elseif (a <= 1.62e+122) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.4e+124], x, If[LessEqual[a, -1.95e-118], t, If[LessEqual[a, -4e-294], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[a, 1.62e+122], t, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.4 \cdot 10^{+124}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-118}:\\
\;\;\;\;t\\
\mathbf{elif}\;a \leq -4 \cdot 10^{-294}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;a \leq 1.62 \cdot 10^{+122}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.40000000000000046e124 or 1.61999999999999994e122 < a Initial program 89.7%
Taylor expanded in a around inf
Applied rewrites51.3%
if -8.40000000000000046e124 < a < -1.95e-118 or -4.00000000000000007e-294 < a < 1.61999999999999994e122Initial program 77.2%
Taylor expanded in z around inf
Applied rewrites30.4%
if -1.95e-118 < a < -4.00000000000000007e-294Initial program 69.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6431.3
Applied rewrites31.3%
Taylor expanded in a around 0
lower-/.f6432.7
Applied rewrites32.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t a) (- y z) x)))
(if (<= a -8.4e+124)
t_1
(if (<= a 3.8e+110) (* t (/ (- y z) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -8.4e+124) {
tmp = t_1;
} else if (a <= 3.8e+110) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -8.4e+124) tmp = t_1; elseif (a <= 3.8e+110) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -8.4e+124], t$95$1, If[LessEqual[a, 3.8e+110], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -8.4 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+110}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.40000000000000046e124 or 3.79999999999999989e110 < a Initial program 89.6%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6489.7
Applied rewrites89.7%
Taylor expanded in x around 0
Applied rewrites82.4%
Taylor expanded in z around 0
Applied rewrites75.2%
if -8.40000000000000046e124 < a < 3.79999999999999989e110Initial program 75.5%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6475.6
Applied rewrites75.6%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ t a) (- y z) x))) (if (<= a -4.5e+42) t_1 (if (<= a 2.3e-25) (/ (* (- t x) y) (- a z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -4.5e+42) {
tmp = t_1;
} else if (a <= 2.3e-25) {
tmp = ((t - x) * y) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -4.5e+42) tmp = t_1; elseif (a <= 2.3e-25) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -4.5e+42], t$95$1, If[LessEqual[a, 2.3e-25], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-25}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.50000000000000012e42 or 2.2999999999999999e-25 < a Initial program 87.6%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6487.7
Applied rewrites87.7%
Taylor expanded in x around 0
Applied rewrites77.0%
Taylor expanded in z around 0
Applied rewrites65.4%
if -4.50000000000000012e42 < a < 2.2999999999999999e-25Initial program 72.7%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6451.4
Applied rewrites51.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.7e+120) t (if (<= z 6.5e+155) (fma y (/ (- t x) a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.7e+120) {
tmp = t;
} else if (z <= 6.5e+155) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.7e+120) tmp = t; elseif (z <= 6.5e+155) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.7e+120], t, If[LessEqual[z, 6.5e+155], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+120}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -4.69999999999999993e120 or 6.50000000000000046e155 < z Initial program 58.1%
Taylor expanded in z around inf
Applied rewrites55.3%
if -4.69999999999999993e120 < z < 6.50000000000000046e155Initial program 88.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6460.4
Applied rewrites60.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.12e+73) t (if (<= z 7e+155) (+ x (/ (* t y) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.12e+73) {
tmp = t;
} else if (z <= 7e+155) {
tmp = x + ((t * y) / a);
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.12d+73)) then
tmp = t
else if (z <= 7d+155) then
tmp = x + ((t * y) / a)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.12e+73) {
tmp = t;
} else if (z <= 7e+155) {
tmp = x + ((t * y) / a);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.12e+73: tmp = t elif z <= 7e+155: tmp = x + ((t * y) / a) else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.12e+73) tmp = t; elseif (z <= 7e+155) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.12e+73) tmp = t; elseif (z <= 7e+155) tmp = x + ((t * y) / a); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.12e+73], t, If[LessEqual[z, 7e+155], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+73}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+155}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.12e73 or 6.99999999999999969e155 < z Initial program 60.5%
Taylor expanded in z around inf
Applied rewrites52.5%
if -1.12e73 < z < 6.99999999999999969e155Initial program 88.6%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6458.4
Applied rewrites58.4%
Taylor expanded in x around 0
Applied rewrites49.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.45e+120) t (if (<= z 1.15e-295) (/ (* t (- y z)) a) (if (<= z 6.5e+155) x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e+120) {
tmp = t;
} else if (z <= 1.15e-295) {
tmp = (t * (y - z)) / a;
} else if (z <= 6.5e+155) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.45d+120)) then
tmp = t
else if (z <= 1.15d-295) then
tmp = (t * (y - z)) / a
else if (z <= 6.5d+155) then
tmp = x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e+120) {
tmp = t;
} else if (z <= 1.15e-295) {
tmp = (t * (y - z)) / a;
} else if (z <= 6.5e+155) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.45e+120: tmp = t elif z <= 1.15e-295: tmp = (t * (y - z)) / a elif z <= 6.5e+155: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.45e+120) tmp = t; elseif (z <= 1.15e-295) tmp = Float64(Float64(t * Float64(y - z)) / a); elseif (z <= 6.5e+155) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.45e+120) tmp = t; elseif (z <= 1.15e-295) tmp = (t * (y - z)) / a; elseif (z <= 6.5e+155) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.45e+120], t, If[LessEqual[z, 1.15e-295], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 6.5e+155], x, t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+120}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-295}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+155}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -2.45000000000000005e120 or 6.50000000000000046e155 < z Initial program 58.1%
Taylor expanded in z around inf
Applied rewrites55.3%
if -2.45000000000000005e120 < z < 1.15e-295Initial program 89.4%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f6489.4
Applied rewrites89.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.9
Applied rewrites40.9%
Taylor expanded in z around 0
Applied rewrites26.9%
if 1.15e-295 < z < 6.50000000000000046e155Initial program 86.9%
Taylor expanded in a around inf
Applied rewrites28.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.6e+47) x (if (<= a -2e-295) (* (/ (- y a) z) x) (if (<= a 1.62e+122) t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.6e+47) {
tmp = x;
} else if (a <= -2e-295) {
tmp = ((y - a) / z) * x;
} else if (a <= 1.62e+122) {
tmp = t;
} else {
tmp = x;
}
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 (a <= (-1.6d+47)) then
tmp = x
else if (a <= (-2d-295)) then
tmp = ((y - a) / z) * x
else if (a <= 1.62d+122) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.6e+47) {
tmp = x;
} else if (a <= -2e-295) {
tmp = ((y - a) / z) * x;
} else if (a <= 1.62e+122) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.6e+47: tmp = x elif a <= -2e-295: tmp = ((y - a) / z) * x elif a <= 1.62e+122: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.6e+47) tmp = x; elseif (a <= -2e-295) tmp = Float64(Float64(Float64(y - a) / z) * x); elseif (a <= 1.62e+122) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.6e+47) tmp = x; elseif (a <= -2e-295) tmp = ((y - a) / z) * x; elseif (a <= 1.62e+122) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.6e+47], x, If[LessEqual[a, -2e-295], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[a, 1.62e+122], t, x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-295}:\\
\;\;\;\;\frac{y - a}{z} \cdot x\\
\mathbf{elif}\;a \leq 1.62 \cdot 10^{+122}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.6e47 or 1.61999999999999994e122 < a Initial program 89.1%
Taylor expanded in a around inf
Applied rewrites47.5%
if -1.6e47 < a < -2.00000000000000012e-295Initial program 73.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6432.9
Applied rewrites32.9%
Taylor expanded in z around -inf
lower-/.f64N/A
lower--.f6430.3
Applied rewrites30.3%
if -2.00000000000000012e-295 < a < 1.61999999999999994e122Initial program 76.0%
Taylor expanded in z around inf
Applied rewrites32.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.4e+124) x (if (<= a 1.62e+122) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.4e+124) {
tmp = x;
} else if (a <= 1.62e+122) {
tmp = t;
} else {
tmp = x;
}
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 (a <= (-8.4d+124)) then
tmp = x
else if (a <= 1.62d+122) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.4e+124) {
tmp = x;
} else if (a <= 1.62e+122) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.4e+124: tmp = x elif a <= 1.62e+122: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.4e+124) tmp = x; elseif (a <= 1.62e+122) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.4e+124) tmp = x; elseif (a <= 1.62e+122) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.4e+124], x, If[LessEqual[a, 1.62e+122], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.4 \cdot 10^{+124}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.62 \cdot 10^{+122}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.40000000000000046e124 or 1.61999999999999994e122 < a Initial program 89.7%
Taylor expanded in a around inf
Applied rewrites51.3%
if -8.40000000000000046e124 < a < 1.61999999999999994e122Initial program 75.6%
Taylor expanded in z around inf
Applied rewrites31.5%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 79.8%
Taylor expanded in z around inf
Applied rewrites25.7%
herbie shell --seed 2025095
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))