
(FPCore (x y z t a b)
:precision binary64
(+
x
(/
(*
y
(+
(*
(+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a)
z)
b))
(+
(*
(+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721)
z)
0.607771387771))))double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
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 * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
def code(x, y, z, t, a, b): return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))
function code(x, y, z, t, a, b) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) end
function tmp = code(x, y, z, t, a, b) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b)
:precision binary64
(+
x
(/
(*
y
(+
(*
(+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a)
z)
b))
(+
(*
(+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721)
z)
0.607771387771))))double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
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 * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
def code(x, y, z, t, a, b): return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))
function code(x, y, z, t, a, b) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) end
function tmp = code(x, y, z, t, a, b) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(*
(-
(* (- (* (- z -15.234687407) z) -31.4690115749) z)
-11.9400905721)
z)))
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
INFINITY)
(+
x
(*
(-
(*
(+ (* (+ (* (- (* 3.13060547623 z) -11.1667541262) z) t) z) a)
(/ z (- t_1 -0.607771387771)))
(/ b (- -0.607771387771 t_1)))
y))
(+
(*
(-
(/ (- (/ (- t -457.9610022158428) z) 36.52704169880642) z)
-3.13060547623)
y)
x))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z;
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * (z / (t_1 - -0.607771387771))) - (b / (-0.607771387771 - t_1))) * y);
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z;
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Double.POSITIVE_INFINITY) {
tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * (z / (t_1 - -0.607771387771))) - (b / (-0.607771387771 - t_1))) * y);
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z tmp = 0 if (x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= math.inf: tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * (z / (t_1 - -0.607771387771))) - (b / (-0.607771387771 - t_1))) * y) else: tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = Float64(x + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * Float64(z / Float64(t_1 - -0.607771387771))) - Float64(b / Float64(-0.607771387771 - t_1))) * y)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z; tmp = 0.0; if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * (z / (t_1 - -0.607771387771))) - (b / (-0.607771387771 - t_1))) * y); else tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z), $MachinePrecision] - -31.4690115749), $MachinePrecision] * z), $MachinePrecision] - -11.9400905721), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(N[(N[(N[(N[(N[(N[(N[(N[(3.13060547623 * z), $MachinePrecision] - -11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * N[(z / N[(t$95$1 - -0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b / N[(-0.607771387771 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision] / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(\left(\left(z - -15.234687407\right) \cdot z - -31.4690115749\right) \cdot z - -11.9400905721\right) \cdot z\\
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;x + \left(\left(\left(\left(3.13060547623 \cdot z - -11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot \frac{z}{t\_1 - -0.607771387771} - \frac{b}{-0.607771387771 - t\_1}\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\frac{t - -457.9610022158428}{z} - 36.52704169880642}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.1%
Applied rewrites60.1%
Applied rewrites63.0%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t -457.9610022158428) z) 36.52704169880642)))
(if (<= z -34000.0)
(+ x (* (+ 3.13060547623 (* t_1 (/ 1.0 z))) y))
(if (<= z 122.0)
(+
(*
(+
b
(*
z
(+
a
(* z (+ t (* z (+ 11.1667541262 (* 3.13060547623 z))))))))
(/
y
(-
(* (- (* 31.4690115749 z) -11.9400905721) z)
-0.607771387771)))
x)
(+ (* (- (/ t_1 z) -3.13060547623) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -34000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 122.0) {
tmp = ((b + (z * (a + (z * (t + (z * (11.1667541262 + (3.13060547623 * z)))))))) * (y / ((((31.4690115749 * z) - -11.9400905721) * z) - -0.607771387771))) + x;
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + 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, 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 = ((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0
if (z <= (-34000.0d0)) then
tmp = x + ((3.13060547623d0 + (t_1 * (1.0d0 / z))) * y)
else if (z <= 122.0d0) then
tmp = ((b + (z * (a + (z * (t + (z * (11.1667541262d0 + (3.13060547623d0 * z)))))))) * (y / ((((31.4690115749d0 * z) - (-11.9400905721d0)) * z) - (-0.607771387771d0)))) + x
else
tmp = (((t_1 / z) - (-3.13060547623d0)) * y) + x
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 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -34000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 122.0) {
tmp = ((b + (z * (a + (z * (t + (z * (11.1667541262 + (3.13060547623 * z)))))))) * (y / ((((31.4690115749 * z) - -11.9400905721) * z) - -0.607771387771))) + x;
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642 tmp = 0 if z <= -34000.0: tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y) elif z <= 122.0: tmp = ((b + (z * (a + (z * (t + (z * (11.1667541262 + (3.13060547623 * z)))))))) * (y / ((((31.4690115749 * z) - -11.9400905721) * z) - -0.607771387771))) + x else: tmp = (((t_1 / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) tmp = 0.0 if (z <= -34000.0) tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(t_1 * Float64(1.0 / z))) * y)); elseif (z <= 122.0) tmp = Float64(Float64(Float64(b + Float64(z * Float64(a + Float64(z * Float64(t + Float64(z * Float64(11.1667541262 + Float64(3.13060547623 * z)))))))) * Float64(y / Float64(Float64(Float64(Float64(31.4690115749 * z) - -11.9400905721) * z) - -0.607771387771))) + x); else tmp = Float64(Float64(Float64(Float64(t_1 / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642; tmp = 0.0; if (z <= -34000.0) tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y); elseif (z <= 122.0) tmp = ((b + (z * (a + (z * (t + (z * (11.1667541262 + (3.13060547623 * z)))))))) * (y / ((((31.4690115749 * z) - -11.9400905721) * z) - -0.607771387771))) + x; else tmp = (((t_1 / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision]}, If[LessEqual[z, -34000.0], N[(x + N[(N[(3.13060547623 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 122.0], N[(N[(N[(b + N[(z * N[(a + N[(z * N[(t + N[(z * N[(11.1667541262 + N[(3.13060547623 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(N[(N[(31.4690115749 * z), $MachinePrecision] - -11.9400905721), $MachinePrecision] * z), $MachinePrecision] - -0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(N[(t$95$1 / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{t - -457.9610022158428}{z} - 36.52704169880642\\
\mathbf{if}\;z \leq -34000:\\
\;\;\;\;x + \left(3.13060547623 + t\_1 \cdot \frac{1}{z}\right) \cdot y\\
\mathbf{elif}\;z \leq 122:\\
\;\;\;\;\left(b + z \cdot \left(a + z \cdot \left(t + z \cdot \left(11.1667541262 + 3.13060547623 \cdot z\right)\right)\right)\right) \cdot \frac{y}{\left(31.4690115749 \cdot z - -11.9400905721\right) \cdot z - -0.607771387771} + x\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if z < -34000Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites56.9%
if -34000 < z < 122Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites64.0%
Taylor expanded in z around 0
Applied rewrites63.4%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.4%
Applied rewrites64.2%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
if 122 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t -457.9610022158428) z) 36.52704169880642)))
(if (<= z -34000.0)
(+ x (* (+ 3.13060547623 (* t_1 (/ 1.0 z))) y))
(if (<= z 122.0)
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(* (+ (* 31.4690115749 z) 11.9400905721) z)
0.607771387771)))
(+ (* (- (/ t_1 z) -3.13060547623) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -34000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 122.0) {
tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((((31.4690115749 * z) + 11.9400905721) * z) + 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + 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, 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 = ((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0
if (z <= (-34000.0d0)) then
tmp = x + ((3.13060547623d0 + (t_1 * (1.0d0 / z))) * y)
else if (z <= 122.0d0) then
tmp = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / ((((31.4690115749d0 * z) + 11.9400905721d0) * z) + 0.607771387771d0))
else
tmp = (((t_1 / z) - (-3.13060547623d0)) * y) + x
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 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -34000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 122.0) {
tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((((31.4690115749 * z) + 11.9400905721) * z) + 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642 tmp = 0 if z <= -34000.0: tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y) elif z <= 122.0: tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((((31.4690115749 * z) + 11.9400905721) * z) + 0.607771387771)) else: tmp = (((t_1 / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) tmp = 0.0 if (z <= -34000.0) tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(t_1 * Float64(1.0 / z))) * y)); elseif (z <= 122.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(31.4690115749 * z) + 11.9400905721) * z) + 0.607771387771))); else tmp = Float64(Float64(Float64(Float64(t_1 / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642; tmp = 0.0; if (z <= -34000.0) tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y); elseif (z <= 122.0) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((((31.4690115749 * z) + 11.9400905721) * z) + 0.607771387771)); else tmp = (((t_1 / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision]}, If[LessEqual[z, -34000.0], N[(x + N[(N[(3.13060547623 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 122.0], N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(31.4690115749 * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$1 / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{t - -457.9610022158428}{z} - 36.52704169880642\\
\mathbf{if}\;z \leq -34000:\\
\;\;\;\;x + \left(3.13060547623 + t\_1 \cdot \frac{1}{z}\right) \cdot y\\
\mathbf{elif}\;z \leq 122:\\
\;\;\;\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(31.4690115749 \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if z < -34000Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites56.9%
if -34000 < z < 122Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.7%
if 122 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
INFINITY)
(+
x
(*
(*
(/
-1.0
(-
-0.607771387771
(*
(-
(* (- (* (- z -15.234687407) z) -31.4690115749) z)
-11.9400905721)
z)))
(+
(*
(+ (* (+ (* (- (* 3.13060547623 z) -11.1667541262) z) t) z) a)
z)
b))
y))
(+
(*
(-
(/ (- (/ (- t -457.9610022158428) z) 36.52704169880642) z)
-3.13060547623)
y)
x)))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = x + (((-1.0 / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))) * ((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b)) * y);
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Double.POSITIVE_INFINITY) {
tmp = x + (((-1.0 / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))) * ((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b)) * y);
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= math.inf: tmp = x + (((-1.0 / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))) * ((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b)) * y) else: tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = Float64(x + Float64(Float64(Float64(-1.0 / Float64(-0.607771387771 - Float64(Float64(Float64(Float64(Float64(Float64(z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b)) * y)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = x + (((-1.0 / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))) * ((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b)) * y); else tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(N[(N[(-1.0 / N[(-0.607771387771 - N[(N[(N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z), $MachinePrecision] - -31.4690115749), $MachinePrecision] * z), $MachinePrecision] - -11.9400905721), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(3.13060547623 * z), $MachinePrecision] - -11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision] / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;x + \left(\frac{-1}{-0.607771387771 - \left(\left(\left(z - -15.234687407\right) \cdot z - -31.4690115749\right) \cdot z - -11.9400905721\right) \cdot z} \cdot \left(\left(\left(\left(3.13060547623 \cdot z - -11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\frac{t - -457.9610022158428}{z} - 36.52704169880642}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.1%
Applied rewrites60.1%
Applied rewrites60.1%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t -457.9610022158428) z) 36.52704169880642)))
(if (<= z -4.6e+14)
(+ x (* (+ 3.13060547623 (* t_1 (/ 1.0 z))) y))
(if (<= z 500.0)
(+
x
(/
(* y (+ (* (+ (* t z) a) z) b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
(+ (* (- (/ t_1 z) -3.13060547623) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -4.6e+14) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 500.0) {
tmp = x + ((y * ((((t * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + 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, 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 = ((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0
if (z <= (-4.6d+14)) then
tmp = x + ((3.13060547623d0 + (t_1 * (1.0d0 / z))) * y)
else if (z <= 500.0d0) then
tmp = x + ((y * ((((t * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
else
tmp = (((t_1 / z) - (-3.13060547623d0)) * y) + x
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 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -4.6e+14) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 500.0) {
tmp = x + ((y * ((((t * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642 tmp = 0 if z <= -4.6e+14: tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y) elif z <= 500.0: tmp = x + ((y * ((((t * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)) else: tmp = (((t_1 / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) tmp = 0.0 if (z <= -4.6e+14) tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(t_1 * Float64(1.0 / z))) * y)); elseif (z <= 500.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(t * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))); else tmp = Float64(Float64(Float64(Float64(t_1 / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642; tmp = 0.0; if (z <= -4.6e+14) tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y); elseif (z <= 500.0) tmp = x + ((y * ((((t * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)); else tmp = (((t_1 / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision]}, If[LessEqual[z, -4.6e+14], N[(x + N[(N[(3.13060547623 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 500.0], N[(x + N[(N[(y * N[(N[(N[(N[(t * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$1 / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{t - -457.9610022158428}{z} - 36.52704169880642\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+14}:\\
\;\;\;\;x + \left(3.13060547623 + t\_1 \cdot \frac{1}{z}\right) \cdot y\\
\mathbf{elif}\;z \leq 500:\\
\;\;\;\;x + \frac{y \cdot \left(\left(t \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if z < -4.6e14Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites56.9%
if -4.6e14 < z < 500Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites61.1%
if 500 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t -457.9610022158428) z) 36.52704169880642)))
(if (<= z -0.012)
(+ x (* (+ 3.13060547623 (* t_1 (/ 1.0 z))) y))
(if (<= z 122.0)
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+ (* 11.9400905721 z) 0.607771387771)))
(+ (* (- (/ t_1 z) -3.13060547623) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -0.012) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 122.0) {
tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((11.9400905721 * z) + 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + 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, 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 = ((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0
if (z <= (-0.012d0)) then
tmp = x + ((3.13060547623d0 + (t_1 * (1.0d0 / z))) * y)
else if (z <= 122.0d0) then
tmp = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / ((11.9400905721d0 * z) + 0.607771387771d0))
else
tmp = (((t_1 / z) - (-3.13060547623d0)) * y) + x
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 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -0.012) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 122.0) {
tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((11.9400905721 * z) + 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642 tmp = 0 if z <= -0.012: tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y) elif z <= 122.0: tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((11.9400905721 * z) + 0.607771387771)) else: tmp = (((t_1 / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) tmp = 0.0 if (z <= -0.012) tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(t_1 * Float64(1.0 / z))) * y)); elseif (z <= 122.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(11.9400905721 * z) + 0.607771387771))); else tmp = Float64(Float64(Float64(Float64(t_1 / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642; tmp = 0.0; if (z <= -0.012) tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y); elseif (z <= 122.0) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / ((11.9400905721 * z) + 0.607771387771)); else tmp = (((t_1 / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision]}, If[LessEqual[z, -0.012], N[(x + N[(N[(3.13060547623 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 122.0], N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(11.9400905721 * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$1 / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{t - -457.9610022158428}{z} - 36.52704169880642\\
\mathbf{if}\;z \leq -0.012:\\
\;\;\;\;x + \left(3.13060547623 + t\_1 \cdot \frac{1}{z}\right) \cdot y\\
\mathbf{elif}\;z \leq 122:\\
\;\;\;\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{11.9400905721 \cdot z + 0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if z < -0.012Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites56.9%
if -0.012 < z < 122Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites53.6%
if 122 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
INFINITY)
(-
x
(*
(+
b
(*
(+ a (* (+ t (* (- (* 3.13060547623 z) -11.1667541262) z)) z))
z))
(/
y
(-
-0.607771387771
(*
(-
(* (- (* (- z -15.234687407) z) -31.4690115749) z)
-11.9400905721)
z)))))
(+
(*
(-
(/ (- (/ (- t -457.9610022158428) z) 36.52704169880642) z)
-3.13060547623)
y)
x)))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = x - ((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) * (y / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))));
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Double.POSITIVE_INFINITY) {
tmp = x - ((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) * (y / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))));
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= math.inf: tmp = x - ((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) * (y / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z)))) else: tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = Float64(x - Float64(Float64(b + Float64(Float64(a + Float64(Float64(t + Float64(Float64(Float64(3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) * Float64(y / Float64(-0.607771387771 - Float64(Float64(Float64(Float64(Float64(Float64(z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z))))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = x - ((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) * (y / (-0.607771387771 - ((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z)))); else tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x - N[(N[(b + N[(N[(a + N[(N[(t + N[(N[(N[(3.13060547623 * z), $MachinePrecision] - -11.1667541262), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(y / N[(-0.607771387771 - N[(N[(N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z), $MachinePrecision] - -31.4690115749), $MachinePrecision] * z), $MachinePrecision] - -11.9400905721), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision] / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;x - \left(b + \left(a + \left(t + \left(3.13060547623 \cdot z - -11.1667541262\right) \cdot z\right) \cdot z\right) \cdot z\right) \cdot \frac{y}{-0.607771387771 - \left(\left(\left(z - -15.234687407\right) \cdot z - -31.4690115749\right) \cdot z - -11.9400905721\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\frac{t - -457.9610022158428}{z} - 36.52704169880642}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.1%
Applied rewrites59.6%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
INFINITY)
(+
x
(*
(/
(+
b
(*
(+ a (* (+ t (* (- (* 3.13060547623 z) -11.1667541262) z)) z))
z))
(-
(*
(-
(* (- (* (- z -15.234687407) z) -31.4690115749) z)
-11.9400905721)
z)
-0.607771387771))
y))
(+
(*
(-
(/ (- (/ (- t -457.9610022158428) z) 36.52704169880642) z)
-3.13060547623)
y)
x)))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = x + (((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) / (((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z) - -0.607771387771)) * y);
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Double.POSITIVE_INFINITY) {
tmp = x + (((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) / (((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z) - -0.607771387771)) * y);
} else {
tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= math.inf: tmp = x + (((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) / (((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z) - -0.607771387771)) * y) else: tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = Float64(x + Float64(Float64(Float64(b + Float64(Float64(a + Float64(Float64(t + Float64(Float64(Float64(3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z) - -0.607771387771)) * y)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = x + (((b + ((a + ((t + (((3.13060547623 * z) - -11.1667541262) * z)) * z)) * z)) / (((((((z - -15.234687407) * z) - -31.4690115749) * z) - -11.9400905721) * z) - -0.607771387771)) * y); else tmp = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(N[(N[(b + N[(N[(a + N[(N[(t + N[(N[(N[(3.13060547623 * z), $MachinePrecision] - -11.1667541262), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z), $MachinePrecision] - -31.4690115749), $MachinePrecision] * z), $MachinePrecision] - -11.9400905721), $MachinePrecision] * z), $MachinePrecision] - -0.607771387771), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision] / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;x + \frac{b + \left(a + \left(t + \left(3.13060547623 \cdot z - -11.1667541262\right) \cdot z\right) \cdot z\right) \cdot z}{\left(\left(\left(z - -15.234687407\right) \cdot z - -31.4690115749\right) \cdot z - -11.9400905721\right) \cdot z - -0.607771387771} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\frac{t - -457.9610022158428}{z} - 36.52704169880642}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.1%
Applied rewrites60.1%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t -457.9610022158428) z) 36.52704169880642)))
(if (<= z -235000.0)
(+ x (* (+ 3.13060547623 (* t_1 (/ 1.0 z))) y))
(if (<= z 195.0)
(+
x
(*
(/ 1.0 0.607771387771)
(*
(+
(*
(+
(* (+ (* (- (* 3.13060547623 z) -11.1667541262) z) t) z)
a)
z)
b)
y)))
(+ (* (- (/ t_1 z) -3.13060547623) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -235000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 195.0) {
tmp = x + ((1.0 / 0.607771387771) * (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * y));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + 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, 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 = ((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0
if (z <= (-235000.0d0)) then
tmp = x + ((3.13060547623d0 + (t_1 * (1.0d0 / z))) * y)
else if (z <= 195.0d0) then
tmp = x + ((1.0d0 / 0.607771387771d0) * (((((((((3.13060547623d0 * z) - (-11.1667541262d0)) * z) + t) * z) + a) * z) + b) * y))
else
tmp = (((t_1 / z) - (-3.13060547623d0)) * y) + x
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 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -235000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 195.0) {
tmp = x + ((1.0 / 0.607771387771) * (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * y));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642 tmp = 0 if z <= -235000.0: tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y) elif z <= 195.0: tmp = x + ((1.0 / 0.607771387771) * (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * y)) else: tmp = (((t_1 / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) tmp = 0.0 if (z <= -235000.0) tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(t_1 * Float64(1.0 / z))) * y)); elseif (z <= 195.0) tmp = Float64(x + Float64(Float64(1.0 / 0.607771387771) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * y))); else tmp = Float64(Float64(Float64(Float64(t_1 / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642; tmp = 0.0; if (z <= -235000.0) tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y); elseif (z <= 195.0) tmp = x + ((1.0 / 0.607771387771) * (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * y)); else tmp = (((t_1 / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision]}, If[LessEqual[z, -235000.0], N[(x + N[(N[(3.13060547623 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 195.0], N[(x + N[(N[(1.0 / 0.607771387771), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(N[(3.13060547623 * z), $MachinePrecision] - -11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$1 / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{t - -457.9610022158428}{z} - 36.52704169880642\\
\mathbf{if}\;z \leq -235000:\\
\;\;\;\;x + \left(3.13060547623 + t\_1 \cdot \frac{1}{z}\right) \cdot y\\
\mathbf{elif}\;z \leq 195:\\
\;\;\;\;x + \frac{1}{0.607771387771} \cdot \left(\left(\left(\left(\left(3.13060547623 \cdot z - -11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if z < -235000Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites56.9%
if -235000 < z < 195Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.3%
Applied rewrites54.3%
if 195 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t -457.9610022158428) z) 36.52704169880642)))
(if (<= z -235000.0)
(+ x (* (+ 3.13060547623 (* t_1 (/ 1.0 z))) y))
(if (<= z 195.0)
(+
x
(*
(+
(*
(+
(* (+ (* (- (* 3.13060547623 z) -11.1667541262) z) t) z)
a)
z)
b)
(/ y 0.607771387771)))
(+ (* (- (/ t_1 z) -3.13060547623) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -235000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 195.0) {
tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * (y / 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + 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, 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 = ((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0
if (z <= (-235000.0d0)) then
tmp = x + ((3.13060547623d0 + (t_1 * (1.0d0 / z))) * y)
else if (z <= 195.0d0) then
tmp = x + (((((((((3.13060547623d0 * z) - (-11.1667541262d0)) * z) + t) * z) + a) * z) + b) * (y / 0.607771387771d0))
else
tmp = (((t_1 / z) - (-3.13060547623d0)) * y) + x
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 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -235000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 195.0) {
tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * (y / 0.607771387771));
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642 tmp = 0 if z <= -235000.0: tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y) elif z <= 195.0: tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * (y / 0.607771387771)) else: tmp = (((t_1 / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) tmp = 0.0 if (z <= -235000.0) tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(t_1 * Float64(1.0 / z))) * y)); elseif (z <= 195.0) tmp = Float64(x + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * Float64(y / 0.607771387771))); else tmp = Float64(Float64(Float64(Float64(t_1 / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642; tmp = 0.0; if (z <= -235000.0) tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y); elseif (z <= 195.0) tmp = x + (((((((((3.13060547623 * z) - -11.1667541262) * z) + t) * z) + a) * z) + b) * (y / 0.607771387771)); else tmp = (((t_1 / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision]}, If[LessEqual[z, -235000.0], N[(x + N[(N[(3.13060547623 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 195.0], N[(x + N[(N[(N[(N[(N[(N[(N[(N[(N[(3.13060547623 * z), $MachinePrecision] - -11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision] * N[(y / 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$1 / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{t - -457.9610022158428}{z} - 36.52704169880642\\
\mathbf{if}\;z \leq -235000:\\
\;\;\;\;x + \left(3.13060547623 + t\_1 \cdot \frac{1}{z}\right) \cdot y\\
\mathbf{elif}\;z \leq 195:\\
\;\;\;\;x + \left(\left(\left(\left(3.13060547623 \cdot z - -11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right) \cdot \frac{y}{0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if z < -235000Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites56.9%
if -235000 < z < 195Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.3%
Applied rewrites54.3%
if 195 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t -457.9610022158428) z) 36.52704169880642)))
(if (<= z -235000.0)
(+ x (* (+ 3.13060547623 (* t_1 (/ 1.0 z))) y))
(if (<= z 195.0)
(+
x
(/
(* y (+ (* (+ (* (+ (* 11.1667541262 z) t) z) a) z) b))
0.607771387771))
(+ (* (- (/ t_1 z) -3.13060547623) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -235000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 195.0) {
tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771);
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + 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, 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 = ((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0
if (z <= (-235000.0d0)) then
tmp = x + ((3.13060547623d0 + (t_1 * (1.0d0 / z))) * y)
else if (z <= 195.0d0) then
tmp = x + ((y * ((((((11.1667541262d0 * z) + t) * z) + a) * z) + b)) / 0.607771387771d0)
else
tmp = (((t_1 / z) - (-3.13060547623d0)) * y) + x
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 = ((t - -457.9610022158428) / z) - 36.52704169880642;
double tmp;
if (z <= -235000.0) {
tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y);
} else if (z <= 195.0) {
tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771);
} else {
tmp = (((t_1 / z) - -3.13060547623) * y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642 tmp = 0 if z <= -235000.0: tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y) elif z <= 195.0: tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771) else: tmp = (((t_1 / z) - -3.13060547623) * y) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) tmp = 0.0 if (z <= -235000.0) tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(t_1 * Float64(1.0 / z))) * y)); elseif (z <= 195.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771)); else tmp = Float64(Float64(Float64(Float64(t_1 / z) - -3.13060547623) * y) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - -457.9610022158428) / z) - 36.52704169880642; tmp = 0.0; if (z <= -235000.0) tmp = x + ((3.13060547623 + (t_1 * (1.0 / z))) * y); elseif (z <= 195.0) tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771); else tmp = (((t_1 / z) - -3.13060547623) * y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision]}, If[LessEqual[z, -235000.0], N[(x + N[(N[(3.13060547623 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 195.0], N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(11.1667541262 * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / 0.607771387771), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$1 / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{t - -457.9610022158428}{z} - 36.52704169880642\\
\mathbf{if}\;z \leq -235000:\\
\;\;\;\;x + \left(3.13060547623 + t\_1 \cdot \frac{1}{z}\right) \cdot y\\
\mathbf{elif}\;z \leq 195:\\
\;\;\;\;x + \frac{y \cdot \left(\left(\left(11.1667541262 \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{z} - -3.13060547623\right) \cdot y + x\\
\end{array}
if z < -235000Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites56.9%
if -235000 < z < 195Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.3%
Taylor expanded in z around 0
Applied rewrites54.4%
if 195 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+
(*
(-
(/ (- (/ (- t -457.9610022158428) z) 36.52704169880642) z)
-3.13060547623)
y)
x)))
(if (<= z -235000.0)
t_1
(if (<= z 195.0)
(+
x
(/
(* y (+ (* (+ (* (+ (* 11.1667541262 z) t) z) a) z) b))
0.607771387771))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
double tmp;
if (z <= -235000.0) {
tmp = t_1;
} else if (z <= 195.0) {
tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771);
} 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 = ((((((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0) / z) - (-3.13060547623d0)) * y) + x
if (z <= (-235000.0d0)) then
tmp = t_1
else if (z <= 195.0d0) then
tmp = x + ((y * ((((((11.1667541262d0 * z) + t) * z) + a) * z) + b)) / 0.607771387771d0)
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 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
double tmp;
if (z <= -235000.0) {
tmp = t_1;
} else if (z <= 195.0) {
tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x tmp = 0 if z <= -235000.0: tmp = t_1 elif z <= 195.0: tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x) tmp = 0.0 if (z <= -235000.0) tmp = t_1; elseif (z <= 195.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x; tmp = 0.0; if (z <= -235000.0) tmp = t_1; elseif (z <= 195.0) tmp = x + ((y * ((((((11.1667541262 * z) + t) * z) + a) * z) + b)) / 0.607771387771); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision] / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -235000.0], t$95$1, If[LessEqual[z, 195.0], N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(11.1667541262 * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / 0.607771387771), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(\frac{\frac{t - -457.9610022158428}{z} - 36.52704169880642}{z} - -3.13060547623\right) \cdot y + x\\
\mathbf{if}\;z \leq -235000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 195:\\
\;\;\;\;x + \frac{y \cdot \left(\left(\left(11.1667541262 \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -235000 or 195 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
if -235000 < z < 195Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.3%
Taylor expanded in z around 0
Applied rewrites54.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+
(*
(-
(/ (- (/ (- t -457.9610022158428) z) 36.52704169880642) z)
-3.13060547623)
y)
x)))
(if (<= z -235000.0)
t_1
(if (<= z 6500.0)
(+ x (/ (* y (+ (* (+ (* t z) a) z) b)) 0.607771387771))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
double tmp;
if (z <= -235000.0) {
tmp = t_1;
} else if (z <= 6500.0) {
tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771);
} 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 = ((((((t - (-457.9610022158428d0)) / z) - 36.52704169880642d0) / z) - (-3.13060547623d0)) * y) + x
if (z <= (-235000.0d0)) then
tmp = t_1
else if (z <= 6500.0d0) then
tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771d0)
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 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x;
double tmp;
if (z <= -235000.0) {
tmp = t_1;
} else if (z <= 6500.0) {
tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x tmp = 0 if z <= -235000.0: tmp = t_1 elif z <= 6500.0: tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x) tmp = 0.0 if (z <= -235000.0) tmp = t_1; elseif (z <= 6500.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(t * z) + a) * z) + b)) / 0.607771387771)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((((t - -457.9610022158428) / z) - 36.52704169880642) / z) - -3.13060547623) * y) + x; tmp = 0.0; if (z <= -235000.0) tmp = t_1; elseif (z <= 6500.0) tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(t - -457.9610022158428), $MachinePrecision] / z), $MachinePrecision] - 36.52704169880642), $MachinePrecision] / z), $MachinePrecision] - -3.13060547623), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -235000.0], t$95$1, If[LessEqual[z, 6500.0], N[(x + N[(N[(y * N[(N[(N[(N[(t * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / 0.607771387771), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(\frac{\frac{t - -457.9610022158428}{z} - 36.52704169880642}{z} - -3.13060547623\right) \cdot y + x\\
\mathbf{if}\;z \leq -235000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6500:\\
\;\;\;\;x + \frac{y \cdot \left(\left(t \cdot z + a\right) \cdot z + b\right)}{0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -235000 or 6500 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6457.0%
Applied rewrites57.0%
if -235000 < z < 6500Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.3%
Taylor expanded in z around 0
Applied rewrites56.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.7e+58)
(+ x (* 3.13060547623 y))
(if (<= z 9.0)
(+ x (/ (* y (+ (* (+ (* t z) a) z) b)) 0.607771387771))
(+ x (* (+ 3.13060547623 (/ -36.52704169880642 z)) y)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.7e+58) {
tmp = x + (3.13060547623 * y);
} else if (z <= 9.0) {
tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771);
} else {
tmp = x + ((3.13060547623 + (-36.52704169880642 / z)) * y);
}
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 (z <= (-4.7d+58)) then
tmp = x + (3.13060547623d0 * y)
else if (z <= 9.0d0) then
tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771d0)
else
tmp = x + ((3.13060547623d0 + ((-36.52704169880642d0) / z)) * y)
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 (z <= -4.7e+58) {
tmp = x + (3.13060547623 * y);
} else if (z <= 9.0) {
tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771);
} else {
tmp = x + ((3.13060547623 + (-36.52704169880642 / z)) * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.7e+58: tmp = x + (3.13060547623 * y) elif z <= 9.0: tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771) else: tmp = x + ((3.13060547623 + (-36.52704169880642 / z)) * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.7e+58) tmp = Float64(x + Float64(3.13060547623 * y)); elseif (z <= 9.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(t * z) + a) * z) + b)) / 0.607771387771)); else tmp = Float64(x + Float64(Float64(3.13060547623 + Float64(-36.52704169880642 / z)) * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.7e+58) tmp = x + (3.13060547623 * y); elseif (z <= 9.0) tmp = x + ((y * ((((t * z) + a) * z) + b)) / 0.607771387771); else tmp = x + ((3.13060547623 + (-36.52704169880642 / z)) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.7e+58], N[(x + N[(3.13060547623 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(N[(y * N[(N[(N[(N[(t * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / 0.607771387771), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(3.13060547623 + N[(-36.52704169880642 / z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+58}:\\
\;\;\;\;x + 3.13060547623 \cdot y\\
\mathbf{elif}\;z \leq 9:\\
\;\;\;\;x + \frac{y \cdot \left(\left(t \cdot z + a\right) \cdot z + b\right)}{0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;x + \left(3.13060547623 + \frac{-36.52704169880642}{z}\right) \cdot y\\
\end{array}
if z < -4.6999999999999997e58Initial program 58.1%
Taylor expanded in z around inf
lower-*.f6463.6%
Applied rewrites63.6%
if -4.6999999999999997e58 < z < 9Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.3%
Taylor expanded in z around 0
Applied rewrites56.6%
if 9 < z Initial program 58.1%
Applied rewrites60.1%
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-+.f6457.0%
Applied rewrites57.0%
Taylor expanded in z around inf
lower-/.f6459.9%
Applied rewrites59.9%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
INFINITY)
(+ x (* (+ (* a z) b) (* y 1.6453555072203998)))
(+ x (* 3.13060547623 y))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = x + (((a * z) + b) * (y * 1.6453555072203998));
} else {
tmp = x + (3.13060547623 * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Double.POSITIVE_INFINITY) {
tmp = x + (((a * z) + b) * (y * 1.6453555072203998));
} else {
tmp = x + (3.13060547623 * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= math.inf: tmp = x + (((a * z) + b) * (y * 1.6453555072203998)) else: tmp = x + (3.13060547623 * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = Float64(x + Float64(Float64(Float64(a * z) + b) * Float64(y * 1.6453555072203998))); else tmp = Float64(x + Float64(3.13060547623 * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = x + (((a * z) + b) * (y * 1.6453555072203998)); else tmp = x + (3.13060547623 * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(N[(N[(a * z), $MachinePrecision] + b), $MachinePrecision] * N[(y * 1.6453555072203998), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(3.13060547623 * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;x + \left(a \cdot z + b\right) \cdot \left(y \cdot 1.6453555072203998\right)\\
\mathbf{else}:\\
\;\;\;\;x + 3.13060547623 \cdot y\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites54.3%
Taylor expanded in z around 0
Applied rewrites59.2%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6459.2%
Applied rewrites59.2%
Taylor expanded in z around 0
Applied rewrites59.2%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.1%
Taylor expanded in z around inf
lower-*.f6463.6%
Applied rewrites63.6%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
INFINITY)
(+ x (* (* 1.6453555072203998 b) y))
(+ x (* 3.13060547623 y))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = x + ((1.6453555072203998 * b) * y);
} else {
tmp = x + (3.13060547623 * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Double.POSITIVE_INFINITY) {
tmp = x + ((1.6453555072203998 * b) * y);
} else {
tmp = x + (3.13060547623 * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= math.inf: tmp = x + ((1.6453555072203998 * b) * y) else: tmp = x + (3.13060547623 * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = Float64(x + Float64(Float64(1.6453555072203998 * b) * y)); else tmp = Float64(x + Float64(3.13060547623 * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = x + ((1.6453555072203998 * b) * y); else tmp = x + (3.13060547623 * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(N[(1.6453555072203998 * b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(3.13060547623 * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;x + \left(1.6453555072203998 \cdot b\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + 3.13060547623 \cdot y\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.1%
Applied rewrites60.1%
Taylor expanded in z around 0
lower-*.f6460.0%
Applied rewrites60.0%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.1%
Taylor expanded in z around inf
lower-*.f6463.6%
Applied rewrites63.6%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z)
a)
z)
b))
(+
(*
(+
(* (+ (* (+ z 15.234687407) z) 31.4690115749) z)
11.9400905721)
z)
0.607771387771)))
INFINITY)
(+ x (* 1.6453555072203998 (* b y)))
(+ x (* 3.13060547623 y))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = x + (1.6453555072203998 * (b * y));
} else {
tmp = x + (3.13060547623 * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Double.POSITIVE_INFINITY) {
tmp = x + (1.6453555072203998 * (b * y));
} else {
tmp = x + (3.13060547623 * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= math.inf: tmp = x + (1.6453555072203998 * (b * y)) else: tmp = x + (3.13060547623 * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = Float64(x + Float64(1.6453555072203998 * Float64(b * y))); else tmp = Float64(x + Float64(3.13060547623 * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = x + (1.6453555072203998 * (b * y)); else tmp = x + (3.13060547623 * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(1.6453555072203998 * N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(3.13060547623 * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;x + 1.6453555072203998 \cdot \left(b \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + 3.13060547623 \cdot y\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.1%
Taylor expanded in z around 0
Applied rewrites64.0%
Taylor expanded in z around 0
Applied rewrites63.4%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6460.0%
Applied rewrites60.0%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.1%
Taylor expanded in z around inf
lower-*.f6463.6%
Applied rewrites63.6%
(FPCore (x y z t a b) :precision binary64 (+ x (* 3.13060547623 y)))
double code(double x, double y, double z, double t, double a, double b) {
return x + (3.13060547623 * y);
}
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 + (3.13060547623d0 * y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (3.13060547623 * y);
}
def code(x, y, z, t, a, b): return x + (3.13060547623 * y)
function code(x, y, z, t, a, b) return Float64(x + Float64(3.13060547623 * y)) end
function tmp = code(x, y, z, t, a, b) tmp = x + (3.13060547623 * y); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(3.13060547623 * y), $MachinePrecision]), $MachinePrecision]
x + 3.13060547623 \cdot y
Initial program 58.1%
Taylor expanded in z around inf
lower-*.f6463.6%
Applied rewrites63.6%
(FPCore (x y z t a b) :precision binary64 (* x 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
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 * 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
def code(x, y, z, t, a, b): return x * 1.0
function code(x, y, z, t, a, b) return Float64(x * 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = x * 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(x * 1.0), $MachinePrecision]
x \cdot 1
Initial program 58.1%
Taylor expanded in x around inf
Applied rewrites52.1%
Taylor expanded in x around inf
Applied rewrites46.2%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D"
:precision binary64
(+ x (/ (* y (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b)) (+ (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z) 0.607771387771))))