
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / 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, b)
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), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / 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, b)
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), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (+ 1.0 (+ a (/ (* b y) t)))))
(if (<= t_2 (- INFINITY))
(* z (+ (/ x (* z t_3)) (/ y (* t t_3))))
(if (<= t_2 2e+301) (/ t_1 (+ (+ a 1.0) (* (/ y t) b))) (/ z b)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = 1.0 + (a + ((b * y) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z * ((x / (z * t_3)) + (y / (t * t_3)));
} else if (t_2 <= 2e+301) {
tmp = t_1 / ((a + 1.0) + ((y / t) * b));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = 1.0 + (a + ((b * y) / t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z * ((x / (z * t_3)) + (y / (t * t_3)));
} else if (t_2 <= 2e+301) {
tmp = t_1 / ((a + 1.0) + ((y / t) * b));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / ((a + 1.0) + ((y * b) / t)) t_3 = 1.0 + (a + ((b * y) / t)) tmp = 0 if t_2 <= -math.inf: tmp = z * ((x / (z * t_3)) + (y / (t * t_3))) elif t_2 <= 2e+301: tmp = t_1 / ((a + 1.0) + ((y / t) * b)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(1.0 + Float64(a + Float64(Float64(b * y) / t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(x / Float64(z * t_3)) + Float64(y / Float64(t * t_3)))); elseif (t_2 <= 2e+301) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); t_3 = 1.0 + (a + ((b * y) / t)); tmp = 0.0; if (t_2 <= -Inf) tmp = z * ((x / (z * t_3)) + (y / (t * t_3))); elseif (t_2 <= 2e+301) tmp = t_1 / ((a + 1.0) + ((y / t) * b)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(z * N[(N[(x / N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+301], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := 1 + \left(a + \frac{b \cdot y}{t}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;z \cdot \left(\frac{x}{z \cdot t\_3} + \frac{y}{t \cdot t\_3}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{t\_1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.4%
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-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites70.8%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6475.1%
Applied rewrites75.1%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 (- INFINITY))
(* z (/ y (- (* b y) (* -1.0 (* t (+ 1.0 a))))))
(if (<= t_2 2e+301) (/ t_1 (+ (+ a 1.0) (* (/ y t) b))) (/ z b)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_2 <= 2e+301) {
tmp = t_1 / ((a + 1.0) + ((y / t) * b));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_2 <= 2e+301) {
tmp = t_1 / ((a + 1.0) + ((y / t) * b));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_2 <= -math.inf: tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))) elif t_2 <= 2e+301: tmp = t_1 / ((a + 1.0) + ((y / t) * b)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(Float64(b * y) - Float64(-1.0 * Float64(t * Float64(1.0 + a)))))); elseif (t_2 <= 2e+301) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_2 <= -Inf) tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))); elseif (t_2 <= 2e+301) tmp = t_1 / ((a + 1.0) + ((y / t) * b)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(z * N[(y / N[(N[(b * y), $MachinePrecision] - N[(-1.0 * N[(t * N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+301], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;z \cdot \frac{y}{b \cdot y - -1 \cdot \left(t \cdot \left(1 + a\right)\right)}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{t\_1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
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-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites66.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6445.5%
Applied rewrites45.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6475.1%
Applied rewrites75.1%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t))))
(if (<= (/ (+ x (/ (* y z) t)) t_1) 2e+301)
(/ (+ x (* (/ y t) z)) t_1)
(/ z b))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double tmp;
if (((x + ((y * z) / t)) / t_1) <= 2e+301) {
tmp = (x + ((y / t) * z)) / t_1;
} else {
tmp = z / b;
}
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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a + 1.0d0) + ((y * b) / t)
if (((x + ((y * z) / t)) / t_1) <= 2d+301) then
tmp = (x + ((y / t) * z)) / t_1
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double tmp;
if (((x + ((y * z) / t)) / t_1) <= 2e+301) {
tmp = (x + ((y / t) * z)) / t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + ((y * b) / t) tmp = 0 if ((x + ((y * z) / t)) / t_1) <= 2e+301: tmp = (x + ((y / t) * z)) / t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) <= 2e+301) tmp = Float64(Float64(x + Float64(Float64(y / t) * z)) / t_1); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + 1.0) + ((y * b) / t); tmp = 0.0; if (((x + ((y * z) / t)) / t_1) <= 2e+301) tmp = (x + ((y / t) * z)) / t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], 2e+301], N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{t\_1} \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{x + \frac{y}{t} \cdot z}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6475.0%
Applied rewrites75.0%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(* z (/ y (- (* b y) (* -1.0 (* t (+ 1.0 a))))))
(if (<= t_1 2e+301)
(* (/ t (- (* b y) (* (- -1.0 a) t))) (+ (/ (* z y) t) x))
(/ z b)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_1 <= 2e+301) {
tmp = (t / ((b * y) - ((-1.0 - a) * t))) * (((z * y) / t) + x);
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_1 <= 2e+301) {
tmp = (t / ((b * y) - ((-1.0 - a) * t))) * (((z * y) / t) + x);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -math.inf: tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))) elif t_1 <= 2e+301: tmp = (t / ((b * y) - ((-1.0 - a) * t))) * (((z * y) / t) + x) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(Float64(b * y) - Float64(-1.0 * Float64(t * Float64(1.0 + a)))))); elseif (t_1 <= 2e+301) tmp = Float64(Float64(t / Float64(Float64(b * y) - Float64(Float64(-1.0 - a) * t))) * Float64(Float64(Float64(z * y) / t) + x)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -Inf) tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))); elseif (t_1 <= 2e+301) tmp = (t / ((b * y) - ((-1.0 - a) * t))) * (((z * y) / t) + x); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y / N[(N[(b * y), $MachinePrecision] - N[(-1.0 * N[(t * N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+301], N[(N[(t / N[(N[(b * y), $MachinePrecision] - N[(N[(-1.0 - a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;z \cdot \frac{y}{b \cdot y - -1 \cdot \left(t \cdot \left(1 + a\right)\right)}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{t}{b \cdot y - \left(-1 - a\right) \cdot t} \cdot \left(\frac{z \cdot y}{t} + x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
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-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites66.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6445.5%
Applied rewrites45.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(* z (/ y (- (* b y) (* -1.0 (* t (+ 1.0 a))))))
(if (<= t_1 -5e+172)
(/ x (+ 1.0 (+ a (/ (* b y) t))))
(if (<= t_1 2e+301)
(/ (+ (* t x) (* z y)) (+ (* a t) (+ (* b y) t)))
(/ z b))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_1 <= -5e+172) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (t_1 <= 2e+301) {
tmp = ((t * x) + (z * y)) / ((a * t) + ((b * y) + t));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_1 <= -5e+172) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (t_1 <= 2e+301) {
tmp = ((t * x) + (z * y)) / ((a * t) + ((b * y) + t));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -math.inf: tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))) elif t_1 <= -5e+172: tmp = x / (1.0 + (a + ((b * y) / t))) elif t_1 <= 2e+301: tmp = ((t * x) + (z * y)) / ((a * t) + ((b * y) + t)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(Float64(b * y) - Float64(-1.0 * Float64(t * Float64(1.0 + a)))))); elseif (t_1 <= -5e+172) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))); elseif (t_1 <= 2e+301) tmp = Float64(Float64(Float64(t * x) + Float64(z * y)) / Float64(Float64(a * t) + Float64(Float64(b * y) + t))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -Inf) tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))); elseif (t_1 <= -5e+172) tmp = x / (1.0 + (a + ((b * y) / t))); elseif (t_1 <= 2e+301) tmp = ((t * x) + (z * y)) / ((a * t) + ((b * y) + t)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y / N[(N[(b * y), $MachinePrecision] - N[(-1.0 * N[(t * N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e+172], N[(x / N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+301], N[(N[(N[(t * x), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(N[(a * t), $MachinePrecision] + N[(N[(b * y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;z \cdot \frac{y}{b \cdot y - -1 \cdot \left(t \cdot \left(1 + a\right)\right)}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+172}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{t \cdot x + z \cdot y}{a \cdot t + \left(b \cdot y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
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-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites66.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6445.5%
Applied rewrites45.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000001e172Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.2%
Applied rewrites52.2%
if -5.0000000000000001e172 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites70.9%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ 1.0 a)))
(t_3 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_3 (- INFINITY))
(* z (/ y (- (* b y) (* -1.0 (* t (+ 1.0 a))))))
(if (<= t_3 -2e-211)
t_2
(if (<= t_3 0.0)
(/ x (+ 1.0 (+ a (/ (* b y) t))))
(if (<= t_3 2e+301) t_2 (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / (1.0 + a);
double t_3 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_3 <= -2e-211) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (t_3 <= 2e+301) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / (1.0 + a);
double t_3 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a)))));
} else if (t_3 <= -2e-211) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (t_3 <= 2e+301) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / (1.0 + a) t_3 = t_1 / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_3 <= -math.inf: tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))) elif t_3 <= -2e-211: tmp = t_2 elif t_3 <= 0.0: tmp = x / (1.0 + (a + ((b * y) / t))) elif t_3 <= 2e+301: tmp = t_2 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(1.0 + a)) t_3 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(z * Float64(y / Float64(Float64(b * y) - Float64(-1.0 * Float64(t * Float64(1.0 + a)))))); elseif (t_3 <= -2e-211) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))); elseif (t_3 <= 2e+301) tmp = t_2; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / (1.0 + a); t_3 = t_1 / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_3 <= -Inf) tmp = z * (y / ((b * y) - (-1.0 * (t * (1.0 + a))))); elseif (t_3 <= -2e-211) tmp = t_2; elseif (t_3 <= 0.0) tmp = x / (1.0 + (a + ((b * y) / t))); elseif (t_3 <= 2e+301) tmp = t_2; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(z * N[(y / N[(N[(b * y), $MachinePrecision] - N[(-1.0 * N[(t * N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -2e-211], t$95$2, If[LessEqual[t$95$3, 0.0], N[(x / N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+301], t$95$2, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{1 + a}\\
t_3 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;z \cdot \frac{y}{b \cdot y - -1 \cdot \left(t \cdot \left(1 + a\right)\right)}\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-211}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
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-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites66.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6445.5%
Applied rewrites45.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.0000000000000002e-211 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
Taylor expanded in y around 0
lower-+.f6456.8%
Applied rewrites56.8%
if -2.0000000000000002e-211 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.2%
Applied rewrites52.2%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ 1.0 a)))
(t_3 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_3 (- INFINITY))
(/ (+ (/ (* x t) y) z) b)
(if (<= t_3 -2e-211)
t_2
(if (<= t_3 0.0)
(/ x (+ 1.0 (+ a (/ (* b y) t))))
(if (<= t_3 2e+301) t_2 (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / (1.0 + a);
double t_3 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (((x * t) / y) + z) / b;
} else if (t_3 <= -2e-211) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (t_3 <= 2e+301) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / (1.0 + a);
double t_3 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = (((x * t) / y) + z) / b;
} else if (t_3 <= -2e-211) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else if (t_3 <= 2e+301) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / (1.0 + a) t_3 = t_1 / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_3 <= -math.inf: tmp = (((x * t) / y) + z) / b elif t_3 <= -2e-211: tmp = t_2 elif t_3 <= 0.0: tmp = x / (1.0 + (a + ((b * y) / t))) elif t_3 <= 2e+301: tmp = t_2 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(1.0 + a)) t_3 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(x * t) / y) + z) / b); elseif (t_3 <= -2e-211) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))); elseif (t_3 <= 2e+301) tmp = t_2; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / (1.0 + a); t_3 = t_1 / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_3 <= -Inf) tmp = (((x * t) / y) + z) / b; elseif (t_3 <= -2e-211) tmp = t_2; elseif (t_3 <= 0.0) tmp = x / (1.0 + (a + ((b * y) / t))); elseif (t_3 <= 2e+301) tmp = t_2; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$3, -2e-211], t$95$2, If[LessEqual[t$95$3, 0.0], N[(x / N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+301], t$95$2, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{1 + a}\\
t_3 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\frac{\frac{x \cdot t}{y} + z}{b}\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-211}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6431.0%
Applied rewrites31.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6434.9%
Applied rewrites34.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6435.0%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
add-to-fraction-revN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6440.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6440.5%
Applied rewrites40.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.0000000000000002e-211 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
Taylor expanded in y around 0
lower-+.f6456.8%
Applied rewrites56.8%
if -2.0000000000000002e-211 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.2%
Applied rewrites52.2%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* (- z) (* y (/ -1.0 t)))) (+ 1.0 a))))
(if (<= a -1.75e+18)
t_1
(if (<= a 4.5e+61)
(/ (+ (* t x) (* y z)) (- (* b y) (* -1.0 t)))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (-z * (y * (-1.0 / t)))) / (1.0 + a);
double tmp;
if (a <= -1.75e+18) {
tmp = t_1;
} else if (a <= 4.5e+61) {
tmp = ((t * x) + (y * z)) / ((b * y) - (-1.0 * 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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (-z * (y * ((-1.0d0) / t)))) / (1.0d0 + a)
if (a <= (-1.75d+18)) then
tmp = t_1
else if (a <= 4.5d+61) then
tmp = ((t * x) + (y * z)) / ((b * y) - ((-1.0d0) * 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 b) {
double t_1 = (x + (-z * (y * (-1.0 / t)))) / (1.0 + a);
double tmp;
if (a <= -1.75e+18) {
tmp = t_1;
} else if (a <= 4.5e+61) {
tmp = ((t * x) + (y * z)) / ((b * y) - (-1.0 * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (-z * (y * (-1.0 / t)))) / (1.0 + a) tmp = 0 if a <= -1.75e+18: tmp = t_1 elif a <= 4.5e+61: tmp = ((t * x) + (y * z)) / ((b * y) - (-1.0 * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(-z) * Float64(y * Float64(-1.0 / t)))) / Float64(1.0 + a)) tmp = 0.0 if (a <= -1.75e+18) tmp = t_1; elseif (a <= 4.5e+61) tmp = Float64(Float64(Float64(t * x) + Float64(y * z)) / Float64(Float64(b * y) - Float64(-1.0 * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (-z * (y * (-1.0 / t)))) / (1.0 + a); tmp = 0.0; if (a <= -1.75e+18) tmp = t_1; elseif (a <= 4.5e+61) tmp = ((t * x) + (y * z)) / ((b * y) - (-1.0 * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[((-z) * N[(y * N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.75e+18], t$95$1, If[LessEqual[a, 4.5e+61], N[(N[(N[(t * x), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(N[(b * y), $MachinePrecision] - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x + \left(-z\right) \cdot \left(y \cdot \frac{-1}{t}\right)}{1 + a}\\
\mathbf{if}\;a \leq -1.75 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+61}:\\
\;\;\;\;\frac{t \cdot x + y \cdot z}{b \cdot y - -1 \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.75e18 or 4.5e61 < a Initial program 75.4%
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
distribute-neg-frac2N/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval75.0%
Applied rewrites75.0%
Taylor expanded in y around 0
lower-+.f6458.4%
Applied rewrites58.4%
if -1.75e18 < a < 4.5e61Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6431.0%
Applied rewrites31.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6449.8%
Applied rewrites49.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (+ a (/ (* b y) t)))))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 (- INFINITY))
(/ (+ (/ (* x t) y) z) b)
(if (<= t_2 -5e+172)
t_1
(if (<= t_2 -2e-89)
(/ (+ (* y z) (* t x)) (* t (- a -1.0)))
(if (<= t_2 2e+301) t_1 (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + ((b * y) / t)));
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (((x * t) / y) + z) / b;
} else if (t_2 <= -5e+172) {
tmp = t_1;
} else if (t_2 <= -2e-89) {
tmp = ((y * z) + (t * x)) / (t * (a - -1.0));
} else if (t_2 <= 2e+301) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + ((b * y) / t)));
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (((x * t) / y) + z) / b;
} else if (t_2 <= -5e+172) {
tmp = t_1;
} else if (t_2 <= -2e-89) {
tmp = ((y * z) + (t * x)) / (t * (a - -1.0));
} else if (t_2 <= 2e+301) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (a + ((b * y) / t))) t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_2 <= -math.inf: tmp = (((x * t) / y) + z) / b elif t_2 <= -5e+172: tmp = t_1 elif t_2 <= -2e-89: tmp = ((y * z) + (t * x)) / (t * (a - -1.0)) elif t_2 <= 2e+301: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(x * t) / y) + z) / b); elseif (t_2 <= -5e+172) tmp = t_1; elseif (t_2 <= -2e-89) tmp = Float64(Float64(Float64(y * z) + Float64(t * x)) / Float64(t * Float64(a - -1.0))); elseif (t_2 <= 2e+301) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (a + ((b * y) / t))); t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_2 <= -Inf) tmp = (((x * t) / y) + z) / b; elseif (t_2 <= -5e+172) tmp = t_1; elseif (t_2 <= -2e-89) tmp = ((y * z) + (t * x)) / (t * (a - -1.0)); elseif (t_2 <= 2e+301) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$2, -5e+172], t$95$1, If[LessEqual[t$95$2, -2e-89], N[(N[(N[(y * z), $MachinePrecision] + N[(t * x), $MachinePrecision]), $MachinePrecision] / N[(t * N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+301], t$95$1, N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{\frac{x \cdot t}{y} + z}{b}\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-89}:\\
\;\;\;\;\frac{y \cdot z + t \cdot x}{t \cdot \left(a - -1\right)}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6431.0%
Applied rewrites31.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6434.9%
Applied rewrites34.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6435.0%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
add-to-fraction-revN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6440.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6440.5%
Applied rewrites40.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000001e172 or -2.0000000000000001e-89 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.2%
Applied rewrites52.2%
if -5.0000000000000001e172 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -2.0000000000000001e-89Initial program 75.4%
Taylor expanded in y around 0
lower-+.f6456.8%
Applied rewrites56.8%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
associate-/l/N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6444.4%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
Applied rewrites44.4%
if 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -9.5e-31)
(/ (+ (/ (* x t) y) z) b)
(if (<= y 2450000000.0)
(/ (+ (* y z) (* t x)) (* t (- a -1.0)))
(/ z b))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.5e-31) {
tmp = (((x * t) / y) + z) / b;
} else if (y <= 2450000000.0) {
tmp = ((y * z) + (t * x)) / (t * (a - -1.0));
} else {
tmp = z / b;
}
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, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-9.5d-31)) then
tmp = (((x * t) / y) + z) / b
else if (y <= 2450000000.0d0) then
tmp = ((y * z) + (t * x)) / (t * (a - (-1.0d0)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.5e-31) {
tmp = (((x * t) / y) + z) / b;
} else if (y <= 2450000000.0) {
tmp = ((y * z) + (t * x)) / (t * (a - -1.0));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9.5e-31: tmp = (((x * t) / y) + z) / b elif y <= 2450000000.0: tmp = ((y * z) + (t * x)) / (t * (a - -1.0)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9.5e-31) tmp = Float64(Float64(Float64(Float64(x * t) / y) + z) / b); elseif (y <= 2450000000.0) tmp = Float64(Float64(Float64(y * z) + Float64(t * x)) / Float64(t * Float64(a - -1.0))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -9.5e-31) tmp = (((x * t) / y) + z) / b; elseif (y <= 2450000000.0) tmp = ((y * z) + (t * x)) / (t * (a - -1.0)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.5e-31], N[(N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 2450000000.0], N[(N[(N[(y * z), $MachinePrecision] + N[(t * x), $MachinePrecision]), $MachinePrecision] / N[(t * N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-31}:\\
\;\;\;\;\frac{\frac{x \cdot t}{y} + z}{b}\\
\mathbf{elif}\;y \leq 2450000000:\\
\;\;\;\;\frac{y \cdot z + t \cdot x}{t \cdot \left(a - -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if y < -9.5000000000000008e-31Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6431.0%
Applied rewrites31.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6434.9%
Applied rewrites34.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6435.0%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
add-to-fraction-revN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6440.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6440.5%
Applied rewrites40.5%
if -9.5000000000000008e-31 < y < 2.45e9Initial program 75.4%
Taylor expanded in y around 0
lower-+.f6456.8%
Applied rewrites56.8%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
associate-/l/N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6444.4%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
Applied rewrites44.4%
if 2.45e9 < y Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) a)))
(if (<= a -1650000.0)
t_1
(if (<= a -1.02e-98)
(/ x (+ 1.0 a))
(if (<= a 4.5e+61) (/ (+ (/ (* x t) y) z) b) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / a;
double tmp;
if (a <= -1650000.0) {
tmp = t_1;
} else if (a <= -1.02e-98) {
tmp = x / (1.0 + a);
} else if (a <= 4.5e+61) {
tmp = (((x * t) / y) + z) / b;
} 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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + ((y * z) / t)) / a
if (a <= (-1650000.0d0)) then
tmp = t_1
else if (a <= (-1.02d-98)) then
tmp = x / (1.0d0 + a)
else if (a <= 4.5d+61) then
tmp = (((x * t) / y) + z) / b
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 b) {
double t_1 = (x + ((y * z) / t)) / a;
double tmp;
if (a <= -1650000.0) {
tmp = t_1;
} else if (a <= -1.02e-98) {
tmp = x / (1.0 + a);
} else if (a <= 4.5e+61) {
tmp = (((x * t) / y) + z) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / a tmp = 0 if a <= -1650000.0: tmp = t_1 elif a <= -1.02e-98: tmp = x / (1.0 + a) elif a <= 4.5e+61: tmp = (((x * t) / y) + z) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / a) tmp = 0.0 if (a <= -1650000.0) tmp = t_1; elseif (a <= -1.02e-98) tmp = Float64(x / Float64(1.0 + a)); elseif (a <= 4.5e+61) tmp = Float64(Float64(Float64(Float64(x * t) / y) + z) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / a; tmp = 0.0; if (a <= -1650000.0) tmp = t_1; elseif (a <= -1.02e-98) tmp = x / (1.0 + a); elseif (a <= 4.5e+61) tmp = (((x * t) / y) + z) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -1650000.0], t$95$1, If[LessEqual[a, -1.02e-98], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e+61], N[(N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{if}\;a \leq -1650000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.02 \cdot 10^{-98}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+61}:\\
\;\;\;\;\frac{\frac{x \cdot t}{y} + z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.65e6 or 4.5e61 < a Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
Taylor expanded in a around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6434.0%
Applied rewrites34.0%
if -1.65e6 < a < -1.02e-98Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
if -1.02e-98 < a < 4.5e61Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6431.0%
Applied rewrites31.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6434.9%
Applied rewrites34.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6435.0%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
add-to-fraction-revN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6440.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6440.5%
Applied rewrites40.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 a))))
(if (<= t -1.2e-33)
t_1
(if (<= t 1.8e-77) (/ (+ (/ (* x t) y) z) b) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + a);
double tmp;
if (t <= -1.2e-33) {
tmp = t_1;
} else if (t <= 1.8e-77) {
tmp = (((x * t) / y) + z) / b;
} 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, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 + a)
if (t <= (-1.2d-33)) then
tmp = t_1
else if (t <= 1.8d-77) then
tmp = (((x * t) / y) + z) / b
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 b) {
double t_1 = x / (1.0 + a);
double tmp;
if (t <= -1.2e-33) {
tmp = t_1;
} else if (t <= 1.8e-77) {
tmp = (((x * t) / y) + z) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + a) tmp = 0 if t <= -1.2e-33: tmp = t_1 elif t <= 1.8e-77: tmp = (((x * t) / y) + z) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + a)) tmp = 0.0 if (t <= -1.2e-33) tmp = t_1; elseif (t <= 1.8e-77) tmp = Float64(Float64(Float64(Float64(x * t) / y) + z) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + a); tmp = 0.0; if (t <= -1.2e-33) tmp = t_1; elseif (t <= 1.8e-77) tmp = (((x * t) / y) + z) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.2e-33], t$95$1, If[LessEqual[t, 1.8e-77], N[(N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{1 + a}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x \cdot t}{y} + z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.2e-33 or 1.8e-77 < t Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
if -1.2e-33 < t < 1.8e-77Initial program 75.4%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites51.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6431.0%
Applied rewrites31.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6434.9%
Applied rewrites34.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6435.0%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
add-to-fraction-revN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6440.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6440.5%
Applied rewrites40.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(/ z b)
(if (<= t_1 2e+301) (/ x (+ 1.0 a)) (/ z b)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z / b;
} else if (t_1 <= 2e+301) {
tmp = x / (1.0 + a);
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z / b;
} else if (t_1 <= 2e+301) {
tmp = x / (1.0 + a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -math.inf: tmp = z / b elif t_1 <= 2e+301: tmp = x / (1.0 + a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z / b); elseif (t_1 <= 2e+301) tmp = Float64(x / Float64(1.0 + a)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -Inf) tmp = z / b; elseif (t_1 <= 2e+301) tmp = x / (1.0 + a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z / b), $MachinePrecision], If[LessEqual[t$95$1, 2e+301], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 2.0000000000000001e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e301Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4.2e-11)
(/ x a)
(if (<= a -8.6e-161)
(+ x (* -1.0 (* a x)))
(if (<= a 4.5e+61) (/ z b) (/ x a)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.2e-11) {
tmp = x / a;
} else if (a <= -8.6e-161) {
tmp = x + (-1.0 * (a * x));
} else if (a <= 4.5e+61) {
tmp = z / b;
} else {
tmp = 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, b)
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), intent (in) :: b
real(8) :: tmp
if (a <= (-4.2d-11)) then
tmp = x / a
else if (a <= (-8.6d-161)) then
tmp = x + ((-1.0d0) * (a * x))
else if (a <= 4.5d+61) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.2e-11) {
tmp = x / a;
} else if (a <= -8.6e-161) {
tmp = x + (-1.0 * (a * x));
} else if (a <= 4.5e+61) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.2e-11: tmp = x / a elif a <= -8.6e-161: tmp = x + (-1.0 * (a * x)) elif a <= 4.5e+61: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.2e-11) tmp = Float64(x / a); elseif (a <= -8.6e-161) tmp = Float64(x + Float64(-1.0 * Float64(a * x))); elseif (a <= 4.5e+61) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.2e-11) tmp = x / a; elseif (a <= -8.6e-161) tmp = x + (-1.0 * (a * x)); elseif (a <= 4.5e+61) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.2e-11], N[(x / a), $MachinePrecision], If[LessEqual[a, -8.6e-161], N[(x + N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e+61], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -8.6 \cdot 10^{-161}:\\
\;\;\;\;x + -1 \cdot \left(a \cdot x\right)\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+61}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
if a < -4.1999999999999997e-11 or 4.5e61 < a Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
if -4.1999999999999997e-11 < a < -8.5999999999999993e-161Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6419.4%
Applied rewrites19.4%
if -8.5999999999999993e-161 < a < 4.5e61Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.2e-11) (/ x a) (if (<= a -8.6e-161) (/ x 1.0) (if (<= a 4.5e+61) (/ z b) (/ x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.2e-11) {
tmp = x / a;
} else if (a <= -8.6e-161) {
tmp = x / 1.0;
} else if (a <= 4.5e+61) {
tmp = z / b;
} else {
tmp = 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, b)
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), intent (in) :: b
real(8) :: tmp
if (a <= (-4.2d-11)) then
tmp = x / a
else if (a <= (-8.6d-161)) then
tmp = x / 1.0d0
else if (a <= 4.5d+61) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.2e-11) {
tmp = x / a;
} else if (a <= -8.6e-161) {
tmp = x / 1.0;
} else if (a <= 4.5e+61) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.2e-11: tmp = x / a elif a <= -8.6e-161: tmp = x / 1.0 elif a <= 4.5e+61: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.2e-11) tmp = Float64(x / a); elseif (a <= -8.6e-161) tmp = Float64(x / 1.0); elseif (a <= 4.5e+61) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.2e-11) tmp = x / a; elseif (a <= -8.6e-161) tmp = x / 1.0; elseif (a <= 4.5e+61) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.2e-11], N[(x / a), $MachinePrecision], If[LessEqual[a, -8.6e-161], N[(x / 1.0), $MachinePrecision], If[LessEqual[a, 4.5e+61], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -8.6 \cdot 10^{-161}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+61}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
if a < -4.1999999999999997e-11 or 4.5e61 < a Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
if -4.1999999999999997e-11 < a < -8.5999999999999993e-161Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around 0
Applied rewrites19.8%
if -8.5999999999999993e-161 < a < 4.5e61Initial program 75.4%
Taylor expanded in y around inf
lower-/.f6434.2%
Applied rewrites34.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.2e-11) (/ x a) (if (<= a 6.2e-41) (/ x 1.0) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.2e-11) {
tmp = x / a;
} else if (a <= 6.2e-41) {
tmp = x / 1.0;
} else {
tmp = 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, b)
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), intent (in) :: b
real(8) :: tmp
if (a <= (-4.2d-11)) then
tmp = x / a
else if (a <= 6.2d-41) then
tmp = x / 1.0d0
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.2e-11) {
tmp = x / a;
} else if (a <= 6.2e-41) {
tmp = x / 1.0;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.2e-11: tmp = x / a elif a <= 6.2e-41: tmp = x / 1.0 else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.2e-11) tmp = Float64(x / a); elseif (a <= 6.2e-41) tmp = Float64(x / 1.0); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.2e-11) tmp = x / a; elseif (a <= 6.2e-41) tmp = x / 1.0; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.2e-11], N[(x / a), $MachinePrecision], If[LessEqual[a, 6.2e-41], N[(x / 1.0), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
if a < -4.1999999999999997e-11 or 6.2e-41 < a Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
if -4.1999999999999997e-11 < a < 6.2e-41Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around 0
Applied rewrites19.8%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
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, b)
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), intent (in) :: b
code = x / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\frac{x}{a}
Initial program 75.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6442.6%
Applied rewrites42.6%
Taylor expanded in a around inf
lower-/.f6426.1%
Applied rewrites26.1%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))