
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (- (* x1 x1) -1.0))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (- (* 2.0 x2) 3.0))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_5 (/ (+ (- (+ x2 x2) x1) t_0) t_1)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* 4.0 t_4) 6.0)))
t_2)
(* t_0 t_4))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))
INFINITY)
(-
(+
(-
(*
(-
(* (- (* 4.0 t_5) 6.0) (* x1 x1))
(*
(*
(-
1.0
(/ (/ (- (- x1 t_0) (+ x2 x2)) (- -1.0 (* x1 x1))) 3.0))
3.0)
(* t_5 (+ x1 x1))))
t_1)
(- (* (* -3.0 (* x1 x1)) t_5) (* t_1 x1)))
x1)
(* -3.0 (/ (- t_0 (+ (+ x2 x2) x1)) t_1)))
(*
(pow x1 4.0)
(+
6.0
(*
-1.0
(/
(+
3.0
(*
-1.0
(/
(+
9.0
(+
(* -1.0 (/ (+ 1.0 (* -2.0 (+ 1.0 (* 3.0 t_3)))) x1))
(* 4.0 t_3)))
x1)))
x1)))))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) - -1.0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = (2.0 * x2) - 3.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = (((x2 + x2) - x1) + t_0) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - (((1.0 - ((((x1 - t_0) - (x2 + x2)) / (-1.0 - (x1 * x1))) / 3.0)) * 3.0) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1));
} else {
tmp = pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) - -1.0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = (2.0 * x2) - 3.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = (((x2 + x2) - x1) + t_0) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)))) <= Double.POSITIVE_INFINITY) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - (((1.0 - ((((x1 - t_0) - (x2 + x2)) / (-1.0 - (x1 * x1))) / 3.0)) * 3.0) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1));
} else {
tmp = Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1)));
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) - -1.0 t_2 = (x1 * x1) + 1.0 t_3 = (2.0 * x2) - 3.0 t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_5 = (((x2 + x2) - x1) + t_0) / t_1 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)))) <= math.inf: tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - (((1.0 - ((((x1 - t_0) - (x2 + x2)) / (-1.0 - (x1 * x1))) / 3.0)) * 3.0) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1)) else: tmp = math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) - -1.0) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(2.0 * x2) - 3.0) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(Float64(Float64(Float64(x2 + x2) - x1) + t_0) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))) * t_2) + Float64(t_0 * t_4)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * t_5) - 6.0) * Float64(x1 * x1)) - Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(x1 - t_0) - Float64(x2 + x2)) / Float64(-1.0 - Float64(x1 * x1))) / 3.0)) * 3.0) * Float64(t_5 * Float64(x1 + x1)))) * t_1) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * t_5) - Float64(t_1 * x1))) + x1) - Float64(-3.0 * Float64(Float64(t_0 - Float64(Float64(x2 + x2) + x1)) / t_1))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(Float64(-1.0 * Float64(Float64(1.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_3)))) / x1)) + Float64(4.0 * t_3))) / x1))) / x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) - -1.0; t_2 = (x1 * x1) + 1.0; t_3 = (2.0 * x2) - 3.0; t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_5 = (((x2 + x2) - x1) + t_0) / t_1; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - (((1.0 - ((((x1 - t_0) - (x2 + x2)) / (-1.0 - (x1 * x1))) / 3.0)) * 3.0) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1)); else tmp = (x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision] + t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(t$95$0 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * t$95$5), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 - N[(N[(N[(N[(x1 - t$95$0), $MachinePrecision] - N[(x2 + x2), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] * N[(t$95$5 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision] - N[(t$95$1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(N[(t$95$0 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(-1.0 * N[(N[(3.0 + N[(-1.0 * N[(N[(9.0 + N[(N[(-1.0 * N[(N[(1.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 - -1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 2 \cdot x2 - 3\\
t_4 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_5 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_0}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_2 + t\_0 \cdot t\_4\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot t\_5 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(\left(1 - \frac{\frac{\left(x1 - t\_0\right) - \left(x2 + x2\right)}{-1 - x1 \cdot x1}}{3}\right) \cdot 3\right) \cdot \left(t\_5 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_1 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot t\_5 - t\_1 \cdot x1\right)\right) + x1\right) - -3 \cdot \frac{t\_0 - \left(\left(x2 + x2\right) + x1\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot t\_3\right)}{x1} + 4 \cdot t\_3\right)}{x1}}{x1}\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 69.7%
Applied rewrites69.8%
Applied rewrites69.8%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Taylor expanded in x1 around -inf
Applied rewrites49.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (- (* x1 x1) -1.0))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3))
(t_5 (/ (+ (- (+ x2 x2) x1) t_0) t_1)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* 4.0 t_4) 6.0)))
t_3)
(* t_0 t_4))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3))))
INFINITY)
(-
(+
(-
(*
(-
(* (- (* 4.0 t_5) 6.0) (* x1 x1))
(* (- 3.0 t_5) (* t_5 (+ x1 x1))))
t_1)
(- (* (* -3.0 (* x1 x1)) t_5) (* t_1 x1)))
x1)
(* -3.0 (/ (- t_0 (+ (+ x2 x2) x1)) t_1)))
(*
(pow x1 4.0)
(+
6.0
(*
-1.0
(/
(+
3.0
(*
-1.0
(/
(+
9.0
(+
(* -1.0 (/ (+ 1.0 (* -2.0 (+ 1.0 (* 3.0 t_2)))) x1))
(* 4.0 t_2)))
x1)))
x1)))))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) - -1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (((x2 + x2) - x1) + t_0) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)))) <= ((double) INFINITY)) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1));
} else {
tmp = pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_2)))) / x1)) + (4.0 * t_2))) / x1))) / x1)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) - -1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (((x2 + x2) - x1) + t_0) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)))) <= Double.POSITIVE_INFINITY) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1));
} else {
tmp = Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_2)))) / x1)) + (4.0 * t_2))) / x1))) / x1)));
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) - -1.0 t_2 = (2.0 * x2) - 3.0 t_3 = (x1 * x1) + 1.0 t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3 t_5 = (((x2 + x2) - x1) + t_0) / t_1 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)))) <= math.inf: tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1)) else: tmp = math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_2)))) / x1)) + (4.0 * t_2))) / x1))) / x1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) - -1.0) t_2 = Float64(Float64(2.0 * x2) - 3.0) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(Float64(Float64(x2 + x2) - x1) + t_0) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))) * t_3) + Float64(t_0 * t_4)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * t_5) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - t_5) * Float64(t_5 * Float64(x1 + x1)))) * t_1) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * t_5) - Float64(t_1 * x1))) + x1) - Float64(-3.0 * Float64(Float64(t_0 - Float64(Float64(x2 + x2) + x1)) / t_1))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(Float64(-1.0 * Float64(Float64(1.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_2)))) / x1)) + Float64(4.0 * t_2))) / x1))) / x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) - -1.0; t_2 = (2.0 * x2) - 3.0; t_3 = (x1 * x1) + 1.0; t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3; t_5 = (((x2 + x2) - x1) + t_0) / t_1; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (((-3.0 * (x1 * x1)) * t_5) - (t_1 * x1))) + x1) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / t_1)); else tmp = (x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_2)))) / x1)) + (4.0 * t_2))) / x1))) / x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision] + t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(t$95$0 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * t$95$5), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - t$95$5), $MachinePrecision] * N[(t$95$5 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision] - N[(t$95$1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(N[(t$95$0 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(-1.0 * N[(N[(3.0 + N[(-1.0 * N[(N[(9.0 + N[(N[(-1.0 * N[(N[(1.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 - -1\\
t_2 := 2 \cdot x2 - 3\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_0}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_3 + t\_0 \cdot t\_4\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_3}\right) \leq \infty:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot t\_5 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - t\_5\right) \cdot \left(t\_5 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_1 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot t\_5 - t\_1 \cdot x1\right)\right) + x1\right) - -3 \cdot \frac{t\_0 - \left(\left(x2 + x2\right) + x1\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot t\_2\right)}{x1} + 4 \cdot t\_2\right)}{x1}}{x1}\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 69.7%
Applied rewrites69.8%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Taylor expanded in x1 around -inf
Applied rewrites49.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (* (* 3.0 x1) x1))
(t_2 (- (* x1 x1) -1.0))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (/ (+ (- (+ x2 x2) x1) t_1) t_2)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* 4.0 t_4) 6.0)))
t_3)
(* t_1 t_4))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))))
INFINITY)
(-
(+
(-
(*
(-
(* (- (* 4.0 t_5) 6.0) (* x1 x1))
(* (- 3.0 t_5) (* t_5 (+ x1 x1))))
t_2)
(* -1.0 x1))
x1)
(* -3.0 (/ (- t_1 (+ (+ x2 x2) x1)) t_2)))
(*
(pow x1 4.0)
(+
6.0
(*
-1.0
(/
(+
3.0
(*
-1.0
(/
(+
9.0
(+
(* -1.0 (/ (+ 1.0 (* -2.0 (+ 1.0 (* 3.0 t_0)))) x1))
(* 4.0 t_0)))
x1)))
x1)))))))double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = (x1 * x1) - -1.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = (((x2 + x2) - x1) + t_1) / t_2;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)))) <= ((double) INFINITY)) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_2) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_2));
} else {
tmp = pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = (x1 * x1) - -1.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = (((x2 + x2) - x1) + t_1) / t_2;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)))) <= Double.POSITIVE_INFINITY) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_2) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_2));
} else {
tmp = Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = (3.0 * x1) * x1 t_2 = (x1 * x1) - -1.0 t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 t_5 = (((x2 + x2) - x1) + t_1) / t_2 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)))) <= math.inf: tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_2) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_2)) else: tmp = math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(Float64(3.0 * x1) * x1) t_2 = Float64(Float64(x1 * x1) - -1.0) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(Float64(Float64(x2 + x2) - x1) + t_1) / t_2) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))) * t_3) + Float64(t_1 * t_4)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * t_5) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - t_5) * Float64(t_5 * Float64(x1 + x1)))) * t_2) - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(Float64(t_1 - Float64(Float64(x2 + x2) + x1)) / t_2))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(Float64(-1.0 * Float64(Float64(1.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_0)))) / x1)) + Float64(4.0 * t_0))) / x1))) / x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = (3.0 * x1) * x1; t_2 = (x1 * x1) - -1.0; t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; t_5 = (((x2 + x2) - x1) + t_1) / t_2; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_2) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_2)); else tmp = (x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * t$95$5), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - t$95$5), $MachinePrecision] * N[(t$95$5 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(N[(t$95$1 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(-1.0 * N[(N[(3.0 + N[(-1.0 * N[(N[(9.0 + N[(N[(-1.0 * N[(N[(1.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := x1 \cdot x1 - -1\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_1}{t\_2}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_3 + t\_1 \cdot t\_4\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3}\right) \leq \infty:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot t\_5 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - t\_5\right) \cdot \left(t\_5 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_2 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_1 - \left(\left(x2 + x2\right) + x1\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot t\_0\right)}{x1} + 4 \cdot t\_0\right)}{x1}}{x1}\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Taylor expanded in x1 around -inf
Applied rewrites49.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (- (* x1 x1) -1.0))
(t_2 (* (* 3.0 x1) x1))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(t_5 (/ (+ (* 2.0 x2) t_2) t_1)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* 4.0 t_4) 6.0)))
t_3)
(* t_2 t_4))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3))))
INFINITY)
(-
(+
(-
(*
(-
(* (- (* 4.0 t_5) 6.0) (* x1 x1))
(* (- 3.0 t_5) (* t_5 (+ x1 x1))))
t_1)
(* -1.0 x1))
x1)
(* -3.0 (/ (- t_2 (+ (+ x2 x2) x1)) t_1)))
(*
(pow x1 4.0)
(+
6.0
(*
-1.0
(/
(+
3.0
(*
-1.0
(/
(+
9.0
(+
(* -1.0 (/ (+ 1.0 (* -2.0 (+ 1.0 (* 3.0 t_0)))) x1))
(* 4.0 t_0)))
x1)))
x1)))))))double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * x1) - -1.0;
double t_2 = (3.0 * x1) * x1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = ((2.0 * x2) + t_2) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_2 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)))) <= ((double) INFINITY)) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (-1.0 * x1)) + x1) - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_1));
} else {
tmp = pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * x1) - -1.0;
double t_2 = (3.0 * x1) * x1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = ((2.0 * x2) + t_2) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_2 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)))) <= Double.POSITIVE_INFINITY) {
tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (-1.0 * x1)) + x1) - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_1));
} else {
tmp = Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = (x1 * x1) - -1.0 t_2 = (3.0 * x1) * x1 t_3 = (x1 * x1) + 1.0 t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3 t_5 = ((2.0 * x2) + t_2) / t_1 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_2 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)))) <= math.inf: tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (-1.0 * x1)) + x1) - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_1)) else: tmp = math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(Float64(x1 * x1) - -1.0) t_2 = Float64(Float64(3.0 * x1) * x1) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(Float64(2.0 * x2) + t_2) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))) * t_3) + Float64(t_2 * t_4)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * t_5) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - t_5) * Float64(t_5 * Float64(x1 + x1)))) * t_1) - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(Float64(t_2 - Float64(Float64(x2 + x2) + x1)) / t_1))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(Float64(-1.0 * Float64(Float64(1.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_0)))) / x1)) + Float64(4.0 * t_0))) / x1))) / x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = (x1 * x1) - -1.0; t_2 = (3.0 * x1) * x1; t_3 = (x1 * x1) + 1.0; t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3; t_5 = ((2.0 * x2) + t_2) / t_1; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_3) + (t_2 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = (((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_1) - (-1.0 * x1)) + x1) - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_1)); else tmp = (x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(2.0 * x2), $MachinePrecision] + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(t$95$2 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * t$95$5), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - t$95$5), $MachinePrecision] * N[(t$95$5 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(N[(t$95$2 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(-1.0 * N[(N[(3.0 + N[(-1.0 * N[(N[(9.0 + N[(N[(-1.0 * N[(N[(1.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot x1 - -1\\
t_2 := \left(3 \cdot x1\right) \cdot x1\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \frac{2 \cdot x2 + t\_2}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_3 + t\_2 \cdot t\_4\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_3}\right) \leq \infty:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot t\_5 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - t\_5\right) \cdot \left(t\_5 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_1 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_2 - \left(\left(x2 + x2\right) + x1\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot t\_0\right)}{x1} + 4 \cdot t\_0\right)}{x1}}{x1}\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6472.8%
Applied rewrites72.8%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Taylor expanded in x1 around -inf
Applied rewrites49.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0))
(t_1 (* (* 3.0 x1) x1))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (- (* 2.0 x2) 3.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5 (/ (+ (* 2.0 x2) t_1) t_0)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* 4.0 t_4) 6.0)))
t_2)
(* t_1 t_4))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(-
(+
(-
(* (- (* 6.0 (* x1 x1)) (* (- 3.0 t_5) (* t_5 (+ x1 x1)))) t_0)
(* -1.0 x1))
x1)
(* -3.0 (/ (- t_1 (+ (+ x2 x2) x1)) t_0)))
(*
(pow x1 4.0)
(+
6.0
(*
-1.0
(/
(+
3.0
(*
-1.0
(/
(+
9.0
(+
(* -1.0 (/ (+ 1.0 (* -2.0 (+ 1.0 (* 3.0 t_3)))) x1))
(* 4.0 t_3)))
x1)))
x1)))))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = (2.0 * x2) - 3.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = ((2.0 * x2) + t_1) / t_0;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_0));
} else {
tmp = pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = (2.0 * x2) - 3.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = ((2.0 * x2) + t_1) / t_0;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Double.POSITIVE_INFINITY) {
tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_0));
} else {
tmp = Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 t_1 = (3.0 * x1) * x1 t_2 = (x1 * x1) + 1.0 t_3 = (2.0 * x2) - 3.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_5 = ((2.0 * x2) + t_1) / t_0 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= math.inf: tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_0)) else: tmp = math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) t_1 = Float64(Float64(3.0 * x1) * x1) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(2.0 * x2) - 3.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(Float64(Float64(2.0 * x2) + t_1) / t_0) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0))) * t_2) + Float64(t_1 * t_4)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(6.0 * Float64(x1 * x1)) - Float64(Float64(3.0 - t_5) * Float64(t_5 * Float64(x1 + x1)))) * t_0) - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(Float64(t_1 - Float64(Float64(x2 + x2) + x1)) / t_0))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(Float64(-1.0 * Float64(Float64(1.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_3)))) / x1)) + Float64(4.0 * t_3))) / x1))) / x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; t_1 = (3.0 * x1) * x1; t_2 = (x1 * x1) + 1.0; t_3 = (2.0 * x2) - 3.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_5 = ((2.0 * x2) + t_1) / t_0; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0))) * t_2) + (t_1 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * ((t_1 - ((x2 + x2) + x1)) / t_0)); else tmp = (x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_3)))) / x1)) + (4.0 * t_3))) / x1))) / x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(2.0 * x2), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - t$95$5), $MachinePrecision] * N[(t$95$5 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(N[(t$95$1 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(-1.0 * N[(N[(3.0 + N[(-1.0 * N[(N[(9.0 + N[(N[(-1.0 * N[(N[(1.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 2 \cdot x2 - 3\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_5 := \frac{2 \cdot x2 + t\_1}{t\_0}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_2 + t\_1 \cdot t\_4\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;\left(\left(\left(6 \cdot \left(x1 \cdot x1\right) - \left(3 - t\_5\right) \cdot \left(t\_5 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_1 - \left(\left(x2 + x2\right) + x1\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot t\_3\right)}{x1} + 4 \cdot t\_3\right)}{x1}}{x1}\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6472.8%
Applied rewrites72.8%
Taylor expanded in x1 around inf
Applied rewrites71.2%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Taylor expanded in x1 around -inf
Applied rewrites49.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0))
(t_1 (* (* 3.0 x1) x1))
(t_2 (/ (+ (* 2.0 x2) t_1) t_0))
(t_3 (- t_1 (+ (+ x2 x2) x1))))
(if (<= x1 -5e+153)
(- (* x1 2.0) (* -3.0 (/ t_3 1.0)))
(if (<= x1 5e+127)
(-
(+
(-
(*
(- (* 6.0 (* x1 x1)) (* (- 3.0 t_2) (* t_2 (+ x1 x1))))
t_0)
(* -1.0 x1))
x1)
(* -3.0 (/ t_3 t_0)))
(-
(+
(-
(*
(-
(* (- (* 4.0 3.0) 6.0) (* x1 x1))
(* (- 3.0 3.0) (* 3.0 (+ x1 x1))))
t_0)
(- (* (* -3.0 (* x1 x1)) 3.0) (* t_0 x1)))
x1)
-9.0)))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = ((2.0 * x2) + t_1) / t_0;
double t_3 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -5e+153) {
tmp = (x1 * 2.0) - (-3.0 * (t_3 / 1.0));
} else if (x1 <= 5e+127) {
tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_2) * (t_2 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_3 / t_0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) - (-1.0d0)
t_1 = (3.0d0 * x1) * x1
t_2 = ((2.0d0 * x2) + t_1) / t_0
t_3 = t_1 - ((x2 + x2) + x1)
if (x1 <= (-5d+153)) then
tmp = (x1 * 2.0d0) - ((-3.0d0) * (t_3 / 1.0d0))
else if (x1 <= 5d+127) then
tmp = (((((6.0d0 * (x1 * x1)) - ((3.0d0 - t_2) * (t_2 * (x1 + x1)))) * t_0) - ((-1.0d0) * x1)) + x1) - ((-3.0d0) * (t_3 / t_0))
else
tmp = (((((((4.0d0 * 3.0d0) - 6.0d0) * (x1 * x1)) - ((3.0d0 - 3.0d0) * (3.0d0 * (x1 + x1)))) * t_0) - ((((-3.0d0) * (x1 * x1)) * 3.0d0) - (t_0 * x1))) + x1) - (-9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = ((2.0 * x2) + t_1) / t_0;
double t_3 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -5e+153) {
tmp = (x1 * 2.0) - (-3.0 * (t_3 / 1.0));
} else if (x1 <= 5e+127) {
tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_2) * (t_2 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_3 / t_0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 t_1 = (3.0 * x1) * x1 t_2 = ((2.0 * x2) + t_1) / t_0 t_3 = t_1 - ((x2 + x2) + x1) tmp = 0 if x1 <= -5e+153: tmp = (x1 * 2.0) - (-3.0 * (t_3 / 1.0)) elif x1 <= 5e+127: tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_2) * (t_2 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_3 / t_0)) else: tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) t_1 = Float64(Float64(3.0 * x1) * x1) t_2 = Float64(Float64(Float64(2.0 * x2) + t_1) / t_0) t_3 = Float64(t_1 - Float64(Float64(x2 + x2) + x1)) tmp = 0.0 if (x1 <= -5e+153) tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(t_3 / 1.0))); elseif (x1 <= 5e+127) tmp = Float64(Float64(Float64(Float64(Float64(Float64(6.0 * Float64(x1 * x1)) - Float64(Float64(3.0 - t_2) * Float64(t_2 * Float64(x1 + x1)))) * t_0) - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(t_3 / t_0))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * 3.0) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - 3.0) * Float64(3.0 * Float64(x1 + x1)))) * t_0) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * 3.0) - Float64(t_0 * x1))) + x1) - -9.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; t_1 = (3.0 * x1) * x1; t_2 = ((2.0 * x2) + t_1) / t_0; t_3 = t_1 - ((x2 + x2) + x1); tmp = 0.0; if (x1 <= -5e+153) tmp = (x1 * 2.0) - (-3.0 * (t_3 / 1.0)); elseif (x1 <= 5e+127) tmp = (((((6.0 * (x1 * x1)) - ((3.0 - t_2) * (t_2 * (x1 + x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_3 / t_0)); else tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * x2), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+153], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(t$95$3 / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+127], N[(N[(N[(N[(N[(N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - t$95$2), $MachinePrecision] * N[(t$95$2 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * 3.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - 3.0), $MachinePrecision] * N[(3.0 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[(t$95$0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - -9.0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := \frac{2 \cdot x2 + t\_1}{t\_0}\\
t_3 := t\_1 - \left(\left(x2 + x2\right) + x1\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+153}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{t\_3}{1}\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+127}:\\
\;\;\;\;\left(\left(\left(6 \cdot \left(x1 \cdot x1\right) - \left(3 - t\_2\right) \cdot \left(t\_2 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_3}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot 3 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - 3\right) \cdot \left(3 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot 3 - t\_0 \cdot x1\right)\right) + x1\right) - -9\\
\end{array}
if x1 < -5.0000000000000002e153Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -5.0000000000000002e153 < x1 < 5.0000000000000004e127Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6472.8%
Applied rewrites72.8%
Taylor expanded in x1 around inf
Applied rewrites71.2%
if 5.0000000000000004e127 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around inf
Applied rewrites34.1%
Taylor expanded in x1 around inf
Applied rewrites32.4%
Taylor expanded in x1 around inf
Applied rewrites16.7%
Taylor expanded in x1 around inf
Applied rewrites16.8%
Taylor expanded in x1 around inf
Applied rewrites29.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0))
(t_1 (* (* 3.0 x1) x1))
(t_2 (- t_1 (+ (+ x2 x2) x1))))
(if (<= x1 -1e+154)
(- (* x1 2.0) (* -3.0 (/ t_2 1.0)))
(if (<= x1 -28000.0)
(-
(+
(-
(*
(-
(*
(- (* 4.0 (/ (+ (- (+ x2 x2) x1) t_1) t_0)) 6.0)
(* x1 x1))
(+ 6.0 (* 2.0 (/ (- (* 3.0 (- 3.0 (* 2.0 x2))) 1.0) x1))))
t_0)
(* -1.0 x1))
x1)
(* -3.0 (/ t_2 t_0)))
(if (<= x1 2.7e+31)
(+
(* -1.0 x1)
(* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(-
(+
(-
(*
(-
(* (- (* 4.0 3.0) 6.0) (* x1 x1))
(* (- 3.0 3.0) (* 3.0 (+ x1 x1))))
t_0)
(- (* (* -3.0 (* x1 x1)) 3.0) (* t_0 x1)))
x1)
-9.0))))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -1e+154) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -28000.0) {
tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) - (-1.0d0)
t_1 = (3.0d0 * x1) * x1
t_2 = t_1 - ((x2 + x2) + x1)
if (x1 <= (-1d+154)) then
tmp = (x1 * 2.0d0) - ((-3.0d0) * (t_2 / 1.0d0))
else if (x1 <= (-28000.0d0)) then
tmp = (((((((4.0d0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0d0) * (x1 * x1)) - (6.0d0 + (2.0d0 * (((3.0d0 * (3.0d0 - (2.0d0 * x2))) - 1.0d0) / x1)))) * t_0) - ((-1.0d0) * x1)) + x1) - ((-3.0d0) * (t_2 / t_0))
else if (x1 <= 2.7d+31) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = (((((((4.0d0 * 3.0d0) - 6.0d0) * (x1 * x1)) - ((3.0d0 - 3.0d0) * (3.0d0 * (x1 + x1)))) * t_0) - ((((-3.0d0) * (x1 * x1)) * 3.0d0) - (t_0 * x1))) + x1) - (-9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -1e+154) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -28000.0) {
tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 t_1 = (3.0 * x1) * x1 t_2 = t_1 - ((x2 + x2) + x1) tmp = 0 if x1 <= -1e+154: tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)) elif x1 <= -28000.0: tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)) elif x1 <= 2.7e+31: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) t_1 = Float64(Float64(3.0 * x1) * x1) t_2 = Float64(t_1 - Float64(Float64(x2 + x2) + x1)) tmp = 0.0 if (x1 <= -1e+154) tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(t_2 / 1.0))); elseif (x1 <= -28000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * Float64(Float64(Float64(Float64(x2 + x2) - x1) + t_1) / t_0)) - 6.0) * Float64(x1 * x1)) - Float64(6.0 + Float64(2.0 * Float64(Float64(Float64(3.0 * Float64(3.0 - Float64(2.0 * x2))) - 1.0) / x1)))) * t_0) - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(t_2 / t_0))); elseif (x1 <= 2.7e+31) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * 3.0) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - 3.0) * Float64(3.0 * Float64(x1 + x1)))) * t_0) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * 3.0) - Float64(t_0 * x1))) + x1) - -9.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; t_1 = (3.0 * x1) * x1; t_2 = t_1 - ((x2 + x2) + x1); tmp = 0.0; if (x1 <= -1e+154) tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)); elseif (x1 <= -28000.0) tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)); elseif (x1 <= 2.7e+31) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+154], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -28000.0], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * N[(N[(N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(6.0 + N[(2.0 * N[(N[(N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.7e+31], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * 3.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - 3.0), $MachinePrecision] * N[(3.0 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[(t$95$0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - -9.0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := t\_1 - \left(\left(x2 + x2\right) + x1\right)\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{t\_2}{1}\\
\mathbf{elif}\;x1 \leq -28000:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot \frac{\left(\left(x2 + x2\right) - x1\right) + t\_1}{t\_0} - 6\right) \cdot \left(x1 \cdot x1\right) - \left(6 + 2 \cdot \frac{3 \cdot \left(3 - 2 \cdot x2\right) - 1}{x1}\right)\right) \cdot t\_0 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_2}{t\_0}\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot 3 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - 3\right) \cdot \left(3 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot 3 - t\_0 \cdot x1\right)\right) + x1\right) - -9\\
\end{array}
if x1 < -1e154Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -1e154 < x1 < -28000Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in x1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6424.6%
Applied rewrites24.6%
if -28000 < x1 < 2.6999999999999999e31Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 2.6999999999999999e31 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around inf
Applied rewrites34.1%
Taylor expanded in x1 around inf
Applied rewrites32.4%
Taylor expanded in x1 around inf
Applied rewrites16.7%
Taylor expanded in x1 around inf
Applied rewrites16.8%
Taylor expanded in x1 around inf
Applied rewrites29.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0))
(t_1 (* (* 3.0 x1) x1))
(t_2 (- t_1 (+ (+ x2 x2) x1))))
(if (<= x1 -1e+154)
(- (* x1 2.0) (* -3.0 (/ t_2 1.0)))
(if (<= x1 -28000.0)
(-
(+
(-
(*
(-
(* (- (* 4.0 (/ (+ (* 2.0 x2) t_1) t_0)) 6.0) (* x1 x1))
(+ 6.0 (* 2.0 (/ (- (* 3.0 (- 3.0 (* 2.0 x2))) 1.0) x1))))
t_0)
(* -1.0 x1))
x1)
(* -3.0 (/ t_2 t_0)))
(if (<= x1 2.7e+31)
(+
(* -1.0 x1)
(* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(-
(+
(-
(*
(-
(* (- (* 4.0 3.0) 6.0) (* x1 x1))
(* (- 3.0 3.0) (* 3.0 (+ x1 x1))))
t_0)
(- (* (* -3.0 (* x1 x1)) 3.0) (* t_0 x1)))
x1)
-9.0))))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -1e+154) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -28000.0) {
tmp = (((((((4.0 * (((2.0 * x2) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) - (-1.0d0)
t_1 = (3.0d0 * x1) * x1
t_2 = t_1 - ((x2 + x2) + x1)
if (x1 <= (-1d+154)) then
tmp = (x1 * 2.0d0) - ((-3.0d0) * (t_2 / 1.0d0))
else if (x1 <= (-28000.0d0)) then
tmp = (((((((4.0d0 * (((2.0d0 * x2) + t_1) / t_0)) - 6.0d0) * (x1 * x1)) - (6.0d0 + (2.0d0 * (((3.0d0 * (3.0d0 - (2.0d0 * x2))) - 1.0d0) / x1)))) * t_0) - ((-1.0d0) * x1)) + x1) - ((-3.0d0) * (t_2 / t_0))
else if (x1 <= 2.7d+31) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = (((((((4.0d0 * 3.0d0) - 6.0d0) * (x1 * x1)) - ((3.0d0 - 3.0d0) * (3.0d0 * (x1 + x1)))) * t_0) - ((((-3.0d0) * (x1 * x1)) * 3.0d0) - (t_0 * x1))) + x1) - (-9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -1e+154) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -28000.0) {
tmp = (((((((4.0 * (((2.0 * x2) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 t_1 = (3.0 * x1) * x1 t_2 = t_1 - ((x2 + x2) + x1) tmp = 0 if x1 <= -1e+154: tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)) elif x1 <= -28000.0: tmp = (((((((4.0 * (((2.0 * x2) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)) elif x1 <= 2.7e+31: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) t_1 = Float64(Float64(3.0 * x1) * x1) t_2 = Float64(t_1 - Float64(Float64(x2 + x2) + x1)) tmp = 0.0 if (x1 <= -1e+154) tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(t_2 / 1.0))); elseif (x1 <= -28000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * Float64(Float64(Float64(2.0 * x2) + t_1) / t_0)) - 6.0) * Float64(x1 * x1)) - Float64(6.0 + Float64(2.0 * Float64(Float64(Float64(3.0 * Float64(3.0 - Float64(2.0 * x2))) - 1.0) / x1)))) * t_0) - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(t_2 / t_0))); elseif (x1 <= 2.7e+31) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * 3.0) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - 3.0) * Float64(3.0 * Float64(x1 + x1)))) * t_0) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * 3.0) - Float64(t_0 * x1))) + x1) - -9.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; t_1 = (3.0 * x1) * x1; t_2 = t_1 - ((x2 + x2) + x1); tmp = 0.0; if (x1 <= -1e+154) tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)); elseif (x1 <= -28000.0) tmp = (((((((4.0 * (((2.0 * x2) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (6.0 + (2.0 * (((3.0 * (3.0 - (2.0 * x2))) - 1.0) / x1)))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)); elseif (x1 <= 2.7e+31) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+154], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -28000.0], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * N[(N[(N[(2.0 * x2), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(6.0 + N[(2.0 * N[(N[(N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.7e+31], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * 3.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - 3.0), $MachinePrecision] * N[(3.0 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[(t$95$0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - -9.0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := t\_1 - \left(\left(x2 + x2\right) + x1\right)\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{t\_2}{1}\\
\mathbf{elif}\;x1 \leq -28000:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot \frac{2 \cdot x2 + t\_1}{t\_0} - 6\right) \cdot \left(x1 \cdot x1\right) - \left(6 + 2 \cdot \frac{3 \cdot \left(3 - 2 \cdot x2\right) - 1}{x1}\right)\right) \cdot t\_0 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_2}{t\_0}\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot 3 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - 3\right) \cdot \left(3 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot 3 - t\_0 \cdot x1\right)\right) + x1\right) - -9\\
\end{array}
if x1 < -1e154Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -1e154 < x1 < -28000Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6473.0%
Applied rewrites73.0%
Taylor expanded in x1 around 0
lower-*.f6472.8%
Applied rewrites72.8%
Taylor expanded in x1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6424.6%
Applied rewrites24.6%
if -28000 < x1 < 2.6999999999999999e31Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 2.6999999999999999e31 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around inf
Applied rewrites34.1%
Taylor expanded in x1 around inf
Applied rewrites32.4%
Taylor expanded in x1 around inf
Applied rewrites16.7%
Taylor expanded in x1 around inf
Applied rewrites16.8%
Taylor expanded in x1 around inf
Applied rewrites29.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0))
(t_1 (* (* 3.0 x1) x1))
(t_2 (- t_1 (+ (+ x2 x2) x1))))
(if (<= x1 -4.8e+153)
(- (* x1 2.0) (* -3.0 (/ t_2 1.0)))
(if (<= x1 -5.4e+65)
(-
(+
(-
(*
(-
(*
(- (* 4.0 (/ (+ (- (+ x2 x2) x1) t_1) t_0)) 6.0)
(* x1 x1))
(* 12.0 (* x1 x2)))
t_0)
(* -1.0 x1))
x1)
(* -3.0 (/ t_2 t_0)))
(if (<= x1 2.7e+31)
(+
(* -1.0 x1)
(* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(-
(+
(-
(*
(-
(* (- (* 4.0 3.0) 6.0) (* x1 x1))
(* (- 3.0 3.0) (* 3.0 (+ x1 x1))))
t_0)
(- (* (* -3.0 (* x1 x1)) 3.0) (* t_0 x1)))
x1)
-9.0))))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -4.8e+153) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -5.4e+65) {
tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (12.0 * (x1 * x2))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) - (-1.0d0)
t_1 = (3.0d0 * x1) * x1
t_2 = t_1 - ((x2 + x2) + x1)
if (x1 <= (-4.8d+153)) then
tmp = (x1 * 2.0d0) - ((-3.0d0) * (t_2 / 1.0d0))
else if (x1 <= (-5.4d+65)) then
tmp = (((((((4.0d0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0d0) * (x1 * x1)) - (12.0d0 * (x1 * x2))) * t_0) - ((-1.0d0) * x1)) + x1) - ((-3.0d0) * (t_2 / t_0))
else if (x1 <= 2.7d+31) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = (((((((4.0d0 * 3.0d0) - 6.0d0) * (x1 * x1)) - ((3.0d0 - 3.0d0) * (3.0d0 * (x1 + x1)))) * t_0) - ((((-3.0d0) * (x1 * x1)) * 3.0d0) - (t_0 * x1))) + x1) - (-9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = t_1 - ((x2 + x2) + x1);
double tmp;
if (x1 <= -4.8e+153) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -5.4e+65) {
tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (12.0 * (x1 * x2))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 t_1 = (3.0 * x1) * x1 t_2 = t_1 - ((x2 + x2) + x1) tmp = 0 if x1 <= -4.8e+153: tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)) elif x1 <= -5.4e+65: tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (12.0 * (x1 * x2))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)) elif x1 <= 2.7e+31: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) t_1 = Float64(Float64(3.0 * x1) * x1) t_2 = Float64(t_1 - Float64(Float64(x2 + x2) + x1)) tmp = 0.0 if (x1 <= -4.8e+153) tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(t_2 / 1.0))); elseif (x1 <= -5.4e+65) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * Float64(Float64(Float64(Float64(x2 + x2) - x1) + t_1) / t_0)) - 6.0) * Float64(x1 * x1)) - Float64(12.0 * Float64(x1 * x2))) * t_0) - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(t_2 / t_0))); elseif (x1 <= 2.7e+31) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * 3.0) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - 3.0) * Float64(3.0 * Float64(x1 + x1)))) * t_0) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * 3.0) - Float64(t_0 * x1))) + x1) - -9.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; t_1 = (3.0 * x1) * x1; t_2 = t_1 - ((x2 + x2) + x1); tmp = 0.0; if (x1 <= -4.8e+153) tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)); elseif (x1 <= -5.4e+65) tmp = (((((((4.0 * ((((x2 + x2) - x1) + t_1) / t_0)) - 6.0) * (x1 * x1)) - (12.0 * (x1 * x2))) * t_0) - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)); elseif (x1 <= 2.7e+31) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+153], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.4e+65], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * N[(N[(N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.7e+31], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * 3.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - 3.0), $MachinePrecision] * N[(3.0 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[(t$95$0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - -9.0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := t\_1 - \left(\left(x2 + x2\right) + x1\right)\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+153}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{t\_2}{1}\\
\mathbf{elif}\;x1 \leq -5.4 \cdot 10^{+65}:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot \frac{\left(\left(x2 + x2\right) - x1\right) + t\_1}{t\_0} - 6\right) \cdot \left(x1 \cdot x1\right) - 12 \cdot \left(x1 \cdot x2\right)\right) \cdot t\_0 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_2}{t\_0}\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot 3 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - 3\right) \cdot \left(3 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot 3 - t\_0 \cdot x1\right)\right) + x1\right) - -9\\
\end{array}
if x1 < -4.7999999999999998e153Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -4.7999999999999998e153 < x1 < -5.4000000000000004e65Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
Taylor expanded in x2 around 0
lower-*.f64N/A
lower-*.f6453.9%
Applied rewrites53.9%
if -5.4000000000000004e65 < x1 < 2.6999999999999999e31Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 2.6999999999999999e31 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around inf
Applied rewrites34.1%
Taylor expanded in x1 around inf
Applied rewrites32.4%
Taylor expanded in x1 around inf
Applied rewrites16.7%
Taylor expanded in x1 around inf
Applied rewrites16.8%
Taylor expanded in x1 around inf
Applied rewrites29.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0))
(t_1
(*
(-
(* (- (* 4.0 3.0) 6.0) (* x1 x1))
(* (- 3.0 3.0) (* 3.0 (+ x1 x1))))
t_0))
(t_2 (- (* (* 3.0 x1) x1) (+ (+ x2 x2) x1))))
(if (<= x1 -1e+154)
(- (* x1 2.0) (* -3.0 (/ t_2 1.0)))
(if (<= x1 -1.9e+70)
(- (+ (- t_1 (* -1.0 x1)) x1) (* -3.0 (/ t_2 t_0)))
(if (<= x1 2.7e+31)
(+
(* -1.0 x1)
(* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(-
(+ (- t_1 (- (* (* -3.0 (* x1 x1)) 3.0) (* t_0 x1))) x1)
-9.0))))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = ((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0;
double t_2 = ((3.0 * x1) * x1) - ((x2 + x2) + x1);
double tmp;
if (x1 <= -1e+154) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -1.9e+70) {
tmp = ((t_1 - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = ((t_1 - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) - (-1.0d0)
t_1 = ((((4.0d0 * 3.0d0) - 6.0d0) * (x1 * x1)) - ((3.0d0 - 3.0d0) * (3.0d0 * (x1 + x1)))) * t_0
t_2 = ((3.0d0 * x1) * x1) - ((x2 + x2) + x1)
if (x1 <= (-1d+154)) then
tmp = (x1 * 2.0d0) - ((-3.0d0) * (t_2 / 1.0d0))
else if (x1 <= (-1.9d+70)) then
tmp = ((t_1 - ((-1.0d0) * x1)) + x1) - ((-3.0d0) * (t_2 / t_0))
else if (x1 <= 2.7d+31) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = ((t_1 - ((((-3.0d0) * (x1 * x1)) * 3.0d0) - (t_0 * x1))) + x1) - (-9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = ((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0;
double t_2 = ((3.0 * x1) * x1) - ((x2 + x2) + x1);
double tmp;
if (x1 <= -1e+154) {
tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0));
} else if (x1 <= -1.9e+70) {
tmp = ((t_1 - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0));
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = ((t_1 - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 t_1 = ((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0 t_2 = ((3.0 * x1) * x1) - ((x2 + x2) + x1) tmp = 0 if x1 <= -1e+154: tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)) elif x1 <= -1.9e+70: tmp = ((t_1 - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)) elif x1 <= 2.7e+31: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = ((t_1 - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) t_1 = Float64(Float64(Float64(Float64(Float64(4.0 * 3.0) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - 3.0) * Float64(3.0 * Float64(x1 + x1)))) * t_0) t_2 = Float64(Float64(Float64(3.0 * x1) * x1) - Float64(Float64(x2 + x2) + x1)) tmp = 0.0 if (x1 <= -1e+154) tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(t_2 / 1.0))); elseif (x1 <= -1.9e+70) tmp = Float64(Float64(Float64(t_1 - Float64(-1.0 * x1)) + x1) - Float64(-3.0 * Float64(t_2 / t_0))); elseif (x1 <= 2.7e+31) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * 3.0) - Float64(t_0 * x1))) + x1) - -9.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; t_1 = ((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0; t_2 = ((3.0 * x1) * x1) - ((x2 + x2) + x1); tmp = 0.0; if (x1 <= -1e+154) tmp = (x1 * 2.0) - (-3.0 * (t_2 / 1.0)); elseif (x1 <= -1.9e+70) tmp = ((t_1 - (-1.0 * x1)) + x1) - (-3.0 * (t_2 / t_0)); elseif (x1 <= 2.7e+31) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = ((t_1 - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(4.0 * 3.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - 3.0), $MachinePrecision] * N[(3.0 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+154], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.9e+70], N[(N[(N[(t$95$1 - N[(-1.0 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - N[(-3.0 * N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.7e+31], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[(t$95$0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - -9.0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
t_1 := \left(\left(4 \cdot 3 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - 3\right) \cdot \left(3 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0\\
t_2 := \left(3 \cdot x1\right) \cdot x1 - \left(\left(x2 + x2\right) + x1\right)\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{t\_2}{1}\\
\mathbf{elif}\;x1 \leq -1.9 \cdot 10^{+70}:\\
\;\;\;\;\left(\left(t\_1 - -1 \cdot x1\right) + x1\right) - -3 \cdot \frac{t\_2}{t\_0}\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot 3 - t\_0 \cdot x1\right)\right) + x1\right) - -9\\
\end{array}
if x1 < -1e154Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -1e154 < x1 < -1.8999999999999999e70Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in x1 around inf
Applied rewrites71.2%
Taylor expanded in x1 around inf
Applied rewrites54.8%
Taylor expanded in x1 around inf
Applied rewrites54.8%
if -1.8999999999999999e70 < x1 < 2.6999999999999999e31Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 2.6999999999999999e31 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around inf
Applied rewrites34.1%
Taylor expanded in x1 around inf
Applied rewrites32.4%
Taylor expanded in x1 around inf
Applied rewrites16.7%
Taylor expanded in x1 around inf
Applied rewrites16.8%
Taylor expanded in x1 around inf
Applied rewrites29.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0)))
(if (<= x1 -1.12e+153)
(-
(* x1 2.0)
(* -3.0 (/ (- (* (* 3.0 x1) x1) (+ (+ x2 x2) x1)) 1.0)))
(if (<= x1 -1.95e+76)
(* x2 (- (+ (* -12.0 x1) (* -1.0 (/ x1 x2))) 6.0))
(if (<= x1 2.7e+31)
(+
(* -1.0 x1)
(* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(-
(+
(-
(*
(-
(* (- (* 4.0 3.0) 6.0) (* x1 x1))
(* (- 3.0 3.0) (* 3.0 (+ x1 x1))))
t_0)
(- (* (* -3.0 (* x1 x1)) 3.0) (* t_0 x1)))
x1)
-9.0))))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double tmp;
if (x1 <= -1.12e+153) {
tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0));
} else if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = (x1 * x1) - (-1.0d0)
if (x1 <= (-1.12d+153)) then
tmp = (x1 * 2.0d0) - ((-3.0d0) * ((((3.0d0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0d0))
else if (x1 <= (-1.95d+76)) then
tmp = x2 * ((((-12.0d0) * x1) + ((-1.0d0) * (x1 / x2))) - 6.0d0)
else if (x1 <= 2.7d+31) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = (((((((4.0d0 * 3.0d0) - 6.0d0) * (x1 * x1)) - ((3.0d0 - 3.0d0) * (3.0d0 * (x1 + x1)))) * t_0) - ((((-3.0d0) * (x1 * x1)) * 3.0d0) - (t_0 * x1))) + x1) - (-9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double tmp;
if (x1 <= -1.12e+153) {
tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0));
} else if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= 2.7e+31) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 tmp = 0 if x1 <= -1.12e+153: tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0)) elif x1 <= -1.95e+76: tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0) elif x1 <= 2.7e+31: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) tmp = 0.0 if (x1 <= -1.12e+153) tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(Float64(Float64(Float64(3.0 * x1) * x1) - Float64(Float64(x2 + x2) + x1)) / 1.0))); elseif (x1 <= -1.95e+76) tmp = Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(-1.0 * Float64(x1 / x2))) - 6.0)); elseif (x1 <= 2.7e+31) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * 3.0) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - 3.0) * Float64(3.0 * Float64(x1 + x1)))) * t_0) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * 3.0) - Float64(t_0 * x1))) + x1) - -9.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; tmp = 0.0; if (x1 <= -1.12e+153) tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0)); elseif (x1 <= -1.95e+76) tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0); elseif (x1 <= 2.7e+31) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = (((((((4.0 * 3.0) - 6.0) * (x1 * x1)) - ((3.0 - 3.0) * (3.0 * (x1 + x1)))) * t_0) - (((-3.0 * (x1 * x1)) * 3.0) - (t_0 * x1))) + x1) - -9.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, If[LessEqual[x1, -1.12e+153], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.95e+76], N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(-1.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.7e+31], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(4.0 * 3.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3.0 - 3.0), $MachinePrecision] * N[(3.0 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(N[(N[(-3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[(t$95$0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] - -9.0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
\mathbf{if}\;x1 \leq -1.12 \cdot 10^{+153}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{\left(3 \cdot x1\right) \cdot x1 - \left(\left(x2 + x2\right) + x1\right)}{1}\\
\mathbf{elif}\;x1 \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;x2 \cdot \left(\left(-12 \cdot x1 + -1 \cdot \frac{x1}{x2}\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(4 \cdot 3 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - 3\right) \cdot \left(3 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_0 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot 3 - t\_0 \cdot x1\right)\right) + x1\right) - -9\\
\end{array}
if x1 < -1.1200000000000001e153Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -1.1200000000000001e153 < x1 < -1.9499999999999999e76Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6449.4%
Applied rewrites49.4%
if -1.9499999999999999e76 < x1 < 2.6999999999999999e31Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 2.6999999999999999e31 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around inf
Applied rewrites34.1%
Taylor expanded in x1 around inf
Applied rewrites32.4%
Taylor expanded in x1 around inf
Applied rewrites16.7%
Taylor expanded in x1 around inf
Applied rewrites16.8%
Taylor expanded in x1 around inf
Applied rewrites29.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.12e+153)
(-
(* x1 2.0)
(* -3.0 (/ (- (* (* 3.0 x1) x1) (+ (+ x2 x2) x1)) 1.0)))
(if (<= x1 -1.95e+76)
(* x2 (- (+ (* -12.0 x1) (* -1.0 (/ x1 x2))) 6.0))
(if (<= x1 4e+57)
(+
(* -1.0 x1)
(* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(-
(* x1 (+ 2.0 (* -4.0 (* x2 (- 3.0 (* 2.0 x2))))))
(*
-3.0
(+
(* -2.0 x2)
(* x1 (- (* x1 (- (+ 3.0 x1) (* -2.0 x2))) 1.0)))))))))double code(double x1, double x2) {
double tmp;
if (x1 <= -1.12e+153) {
tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0));
} else if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= 4e+57) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (x1 * (2.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (-3.0 * ((-2.0 * x2) + (x1 * ((x1 * ((3.0 + x1) - (-2.0 * x2))) - 1.0))));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.12d+153)) then
tmp = (x1 * 2.0d0) - ((-3.0d0) * ((((3.0d0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0d0))
else if (x1 <= (-1.95d+76)) then
tmp = x2 * ((((-12.0d0) * x1) + ((-1.0d0) * (x1 / x2))) - 6.0d0)
else if (x1 <= 4d+57) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = (x1 * (2.0d0 + ((-4.0d0) * (x2 * (3.0d0 - (2.0d0 * x2)))))) - ((-3.0d0) * (((-2.0d0) * x2) + (x1 * ((x1 * ((3.0d0 + x1) - ((-2.0d0) * x2))) - 1.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.12e+153) {
tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0));
} else if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= 4e+57) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (x1 * (2.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (-3.0 * ((-2.0 * x2) + (x1 * ((x1 * ((3.0 + x1) - (-2.0 * x2))) - 1.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.12e+153: tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0)) elif x1 <= -1.95e+76: tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0) elif x1 <= 4e+57: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = (x1 * (2.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (-3.0 * ((-2.0 * x2) + (x1 * ((x1 * ((3.0 + x1) - (-2.0 * x2))) - 1.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.12e+153) tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(Float64(Float64(Float64(3.0 * x1) * x1) - Float64(Float64(x2 + x2) + x1)) / 1.0))); elseif (x1 <= -1.95e+76) tmp = Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(-1.0 * Float64(x1 / x2))) - 6.0)); elseif (x1 <= 4e+57) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(x1 * Float64(2.0 + Float64(-4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(-3.0 * Float64(Float64(-2.0 * x2) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(3.0 + x1) - Float64(-2.0 * x2))) - 1.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.12e+153) tmp = (x1 * 2.0) - (-3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0)); elseif (x1 <= -1.95e+76) tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0); elseif (x1 <= 4e+57) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = (x1 * (2.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (-3.0 * ((-2.0 * x2) + (x1 * ((x1 * ((3.0 + x1) - (-2.0 * x2))) - 1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.12e+153], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.95e+76], N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(-1.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+57], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * N[(2.0 + N[(-4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-3.0 * N[(N[(-2.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(3.0 + x1), $MachinePrecision] - N[(-2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.12 \cdot 10^{+153}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{\left(3 \cdot x1\right) \cdot x1 - \left(\left(x2 + x2\right) + x1\right)}{1}\\
\mathbf{elif}\;x1 \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;x2 \cdot \left(\left(-12 \cdot x1 + -1 \cdot \frac{x1}{x2}\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+57}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + -4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - -3 \cdot \left(-2 \cdot x2 + x1 \cdot \left(x1 \cdot \left(\left(3 + x1\right) - -2 \cdot x2\right) - 1\right)\right)\\
\end{array}
if x1 < -1.1200000000000001e153Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -1.1200000000000001e153 < x1 < -1.9499999999999999e76Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6449.4%
Applied rewrites49.4%
if -1.9499999999999999e76 < x1 < 4.0000000000000002e57Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 4.0000000000000002e57 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f6461.3%
Applied rewrites61.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* -3.0 (/ (- (* (* 3.0 x1) x1) (+ (+ x2 x2) x1)) 1.0))))
(if (<= x1 -1.12e+153)
(- (* x1 2.0) t_0)
(if (<= x1 -1.95e+76)
(* x2 (- (+ (* -12.0 x1) (* -1.0 (/ x1 x2))) 6.0))
(if (<= x1 4e-26)
(+
(* -1.0 x1)
(* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(- (* x1 (+ 2.0 (* x2 (- (* 8.0 x2) 12.0)))) t_0))))))double code(double x1, double x2) {
double t_0 = -3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0);
double tmp;
if (x1 <= -1.12e+153) {
tmp = (x1 * 2.0) - t_0;
} else if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= 4e-26) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (x1 * (2.0 + (x2 * ((8.0 * x2) - 12.0)))) - t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = (-3.0d0) * ((((3.0d0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0d0)
if (x1 <= (-1.12d+153)) then
tmp = (x1 * 2.0d0) - t_0
else if (x1 <= (-1.95d+76)) then
tmp = x2 * ((((-12.0d0) * x1) + ((-1.0d0) * (x1 / x2))) - 6.0d0)
else if (x1 <= 4d-26) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = (x1 * (2.0d0 + (x2 * ((8.0d0 * x2) - 12.0d0)))) - t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0);
double tmp;
if (x1 <= -1.12e+153) {
tmp = (x1 * 2.0) - t_0;
} else if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= 4e-26) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (x1 * (2.0 + (x2 * ((8.0 * x2) - 12.0)))) - t_0;
}
return tmp;
}
def code(x1, x2): t_0 = -3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0) tmp = 0 if x1 <= -1.12e+153: tmp = (x1 * 2.0) - t_0 elif x1 <= -1.95e+76: tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0) elif x1 <= 4e-26: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = (x1 * (2.0 + (x2 * ((8.0 * x2) - 12.0)))) - t_0 return tmp
function code(x1, x2) t_0 = Float64(-3.0 * Float64(Float64(Float64(Float64(3.0 * x1) * x1) - Float64(Float64(x2 + x2) + x1)) / 1.0)) tmp = 0.0 if (x1 <= -1.12e+153) tmp = Float64(Float64(x1 * 2.0) - t_0); elseif (x1 <= -1.95e+76) tmp = Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(-1.0 * Float64(x1 / x2))) - 6.0)); elseif (x1 <= 4e-26) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(x1 * Float64(2.0 + Float64(x2 * Float64(Float64(8.0 * x2) - 12.0)))) - t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = -3.0 * ((((3.0 * x1) * x1) - ((x2 + x2) + x1)) / 1.0); tmp = 0.0; if (x1 <= -1.12e+153) tmp = (x1 * 2.0) - t_0; elseif (x1 <= -1.95e+76) tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0); elseif (x1 <= 4e-26) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = (x1 * (2.0 + (x2 * ((8.0 * x2) - 12.0)))) - t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-3.0 * N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.12e+153], N[(N[(x1 * 2.0), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x1, -1.95e+76], N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(-1.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e-26], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * N[(2.0 + N[(x2 * N[(N[(8.0 * x2), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := -3 \cdot \frac{\left(3 \cdot x1\right) \cdot x1 - \left(\left(x2 + x2\right) + x1\right)}{1}\\
\mathbf{if}\;x1 \leq -1.12 \cdot 10^{+153}:\\
\;\;\;\;x1 \cdot 2 - t\_0\\
\mathbf{elif}\;x1 \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;x2 \cdot \left(\left(-12 \cdot x1 + -1 \cdot \frac{x1}{x2}\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-26}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + x2 \cdot \left(8 \cdot x2 - 12\right)\right) - t\_0\\
\end{array}
if x1 < -1.1200000000000001e153Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
if -1.1200000000000001e153 < x1 < -1.9499999999999999e76Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6449.4%
Applied rewrites49.4%
if -1.9499999999999999e76 < x1 < 4.0000000000000002e-26Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 4.0000000000000002e-26 < x1 Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f6468.9%
Applied rewrites68.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 x1) -1.0))
(t_1 (* (* 3.0 x1) x1))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* 4.0 t_3) 6.0)))
t_2)
(* t_1 t_3))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))))
(t_5 (- t_1 (+ (+ x2 x2) x1))))
(if (<= t_4 5e+305)
(+ (* -1.0 x1) (* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(if (<= t_4 INFINITY)
(/
(-
(* (* (- (* (* (- 3.0 (+ x2 x2)) x2) -4.0) -2.0) x1) t_0)
(* -3.0 t_5))
t_0)
(- (* x1 2.0) (* -3.0 (/ t_5 1.0)))))))double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_2) + (t_1 * t_3)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)));
double t_5 = t_1 - ((x2 + x2) + x1);
double tmp;
if (t_4 <= 5e+305) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = (((((((3.0 - (x2 + x2)) * x2) * -4.0) - -2.0) * x1) * t_0) - (-3.0 * t_5)) / t_0;
} else {
tmp = (x1 * 2.0) - (-3.0 * (t_5 / 1.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) - -1.0;
double t_1 = (3.0 * x1) * x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_2) + (t_1 * t_3)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)));
double t_5 = t_1 - ((x2 + x2) + x1);
double tmp;
if (t_4 <= 5e+305) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = (((((((3.0 - (x2 + x2)) * x2) * -4.0) - -2.0) * x1) * t_0) - (-3.0 * t_5)) / t_0;
} else {
tmp = (x1 * 2.0) - (-3.0 * (t_5 / 1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) - -1.0 t_1 = (3.0 * x1) * x1 t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_2) + (t_1 * t_3)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2))) t_5 = t_1 - ((x2 + x2) + x1) tmp = 0 if t_4 <= 5e+305: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) elif t_4 <= math.inf: tmp = (((((((3.0 - (x2 + x2)) * x2) * -4.0) - -2.0) * x1) * t_0) - (-3.0 * t_5)) / t_0 else: tmp = (x1 * 2.0) - (-3.0 * (t_5 / 1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) - -1.0) t_1 = Float64(Float64(3.0 * x1) * x1) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0))) * t_2) + Float64(t_1 * t_3)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) t_5 = Float64(t_1 - Float64(Float64(x2 + x2) + x1)) tmp = 0.0 if (t_4 <= 5e+305) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); elseif (t_4 <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(3.0 - Float64(x2 + x2)) * x2) * -4.0) - -2.0) * x1) * t_0) - Float64(-3.0 * t_5)) / t_0); else tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(t_5 / 1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) - -1.0; t_1 = (3.0 * x1) * x1; t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_2) + (t_1 * t_3)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2))); t_5 = t_1 - ((x2 + x2) + x1); tmp = 0.0; if (t_4 <= 5e+305) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); elseif (t_4 <= Inf) tmp = (((((((3.0 - (x2 + x2)) * x2) * -4.0) - -2.0) * x1) * t_0) - (-3.0 * t_5)) / t_0; else tmp = (x1 * 2.0) - (-3.0 * (t_5 / 1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 5e+305], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(N[(N[(N[(N[(N[(N[(3.0 - N[(x2 + x2), $MachinePrecision]), $MachinePrecision] * x2), $MachinePrecision] * -4.0), $MachinePrecision] - -2.0), $MachinePrecision] * x1), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(-3.0 * t$95$5), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(t$95$5 / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_0 := x1 \cdot x1 - -1\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_3 - 6\right)\right) \cdot t\_2 + t\_1 \cdot t\_3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
t_5 := t\_1 - \left(\left(x2 + x2\right) + x1\right)\\
\mathbf{if}\;t\_4 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{\left(\left(\left(\left(3 - \left(x2 + x2\right)\right) \cdot x2\right) \cdot -4 - -2\right) \cdot x1\right) \cdot t\_0 - -3 \cdot t\_5}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{t\_5}{1}\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 5.0000000000000001e305Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if 5.0000000000000001e305 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
lift--.f64N/A
Applied rewrites51.0%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(+ (* -1.0 x1) (* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))
(- (* x1 2.0) (* -3.0 (/ (- t_0 (+ (+ x2 x2) x1)) 1.0))))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (x1 * 2.0) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / 1.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= Double.POSITIVE_INFINITY) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = (x1 * 2.0) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / 1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= math.inf: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = (x1 * 2.0) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / 1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(Float64(x1 * 2.0) - Float64(-3.0 * Float64(Float64(t_0 - Float64(Float64(x2 + x2) + x1)) / 1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = (x1 * 2.0) - (-3.0 * ((t_0 - ((x2 + x2) + x1)) / 1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * 2.0), $MachinePrecision] - N[(-3.0 * N[(N[(t$95$0 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq \infty:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot 2 - -3 \cdot \frac{t\_0 - \left(\left(x2 + x2\right) + x1\right)}{1}\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
Taylor expanded in x1 around 0
Applied rewrites68.9%
Taylor expanded in x2 around 0
Applied rewrites63.4%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.95e+76) (* x2 (- (+ (* -12.0 x1) (* -1.0 (/ x1 x2))) 6.0)) (+ (* -1.0 x1) (* x2 (- (+ (* -12.0 x1) (* 8.0 (* x1 x2))) 6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.95d+76)) then
tmp = x2 * ((((-12.0d0) * x1) + ((-1.0d0) * (x1 / x2))) - 6.0d0)
else
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.95e+76: tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0) else: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.95e+76) tmp = Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(-1.0 * Float64(x1 / x2))) - 6.0)); else tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.95e+76) tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0); else tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.95e+76], N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(-1.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;x2 \cdot \left(\left(-12 \cdot x1 + -1 \cdot \frac{x1}{x2}\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\end{array}
if x1 < -1.9499999999999999e76Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6449.4%
Applied rewrites49.4%
if -1.9499999999999999e76 < x1 Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+ (* -6.0 x2) (* x1 (- (* x2 (- (* 8.0 x2) 12.0)) 1.0)))))
(if (<= x1 -1.95e+76)
(* x2 (- (+ (* -12.0 x1) (* -1.0 (/ x1 x2))) 6.0))
(if (<= x1 -1.15e-169)
t_0
(if (<= x1 2.6e-162)
(+ (* (- (* -12.0 x1) 6.0) x2) (- x1))
t_0)))))double code(double x1, double x2) {
double t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0));
double tmp;
if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= -1.15e-169) {
tmp = t_0;
} else if (x1 <= 2.6e-162) {
tmp = (((-12.0 * x1) - 6.0) * x2) + -x1;
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = ((-6.0d0) * x2) + (x1 * ((x2 * ((8.0d0 * x2) - 12.0d0)) - 1.0d0))
if (x1 <= (-1.95d+76)) then
tmp = x2 * ((((-12.0d0) * x1) + ((-1.0d0) * (x1 / x2))) - 6.0d0)
else if (x1 <= (-1.15d-169)) then
tmp = t_0
else if (x1 <= 2.6d-162) then
tmp = ((((-12.0d0) * x1) - 6.0d0) * x2) + -x1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0));
double tmp;
if (x1 <= -1.95e+76) {
tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0);
} else if (x1 <= -1.15e-169) {
tmp = t_0;
} else if (x1 <= 2.6e-162) {
tmp = (((-12.0 * x1) - 6.0) * x2) + -x1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0)) tmp = 0 if x1 <= -1.95e+76: tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0) elif x1 <= -1.15e-169: tmp = t_0 elif x1 <= 2.6e-162: tmp = (((-12.0 * x1) - 6.0) * x2) + -x1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(x2 * Float64(Float64(8.0 * x2) - 12.0)) - 1.0))) tmp = 0.0 if (x1 <= -1.95e+76) tmp = Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(-1.0 * Float64(x1 / x2))) - 6.0)); elseif (x1 <= -1.15e-169) tmp = t_0; elseif (x1 <= 2.6e-162) tmp = Float64(Float64(Float64(Float64(-12.0 * x1) - 6.0) * x2) + Float64(-x1)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0)); tmp = 0.0; if (x1 <= -1.95e+76) tmp = x2 * (((-12.0 * x1) + (-1.0 * (x1 / x2))) - 6.0); elseif (x1 <= -1.15e-169) tmp = t_0; elseif (x1 <= 2.6e-162) tmp = (((-12.0 * x1) - 6.0) * x2) + -x1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(x2 * N[(N[(8.0 * x2), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.95e+76], N[(x2 * N[(N[(N[(-12.0 * x1), $MachinePrecision] + N[(-1.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.15e-169], t$95$0, If[LessEqual[x1, 2.6e-162], N[(N[(N[(N[(-12.0 * x1), $MachinePrecision] - 6.0), $MachinePrecision] * x2), $MachinePrecision] + (-x1)), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := -6 \cdot x2 + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)\\
\mathbf{if}\;x1 \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;x2 \cdot \left(\left(-12 \cdot x1 + -1 \cdot \frac{x1}{x2}\right) - 6\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.6 \cdot 10^{-162}:\\
\;\;\;\;\left(-12 \cdot x1 - 6\right) \cdot x2 + \left(-x1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x1 < -1.9499999999999999e76Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6449.4%
Applied rewrites49.4%
if -1.9499999999999999e76 < x1 < -1.15e-169 or 2.6e-162 < x1 Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f6454.3%
Applied rewrites54.3%
if -1.15e-169 < x1 < 2.6e-162Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6443.8%
Applied rewrites43.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+ (* -6.0 x2) (* x1 (- (* x2 (- (* 8.0 x2) 12.0)) 1.0)))))
(if (<= x1 -8e+92)
(* x1 (- (* -12.0 x2) 1.0))
(if (<= x1 -1.15e-169)
t_0
(if (<= x1 2.6e-162)
(+ (* (- (* -12.0 x1) 6.0) x2) (- x1))
t_0)))))double code(double x1, double x2) {
double t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0));
double tmp;
if (x1 <= -8e+92) {
tmp = x1 * ((-12.0 * x2) - 1.0);
} else if (x1 <= -1.15e-169) {
tmp = t_0;
} else if (x1 <= 2.6e-162) {
tmp = (((-12.0 * x1) - 6.0) * x2) + -x1;
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = ((-6.0d0) * x2) + (x1 * ((x2 * ((8.0d0 * x2) - 12.0d0)) - 1.0d0))
if (x1 <= (-8d+92)) then
tmp = x1 * (((-12.0d0) * x2) - 1.0d0)
else if (x1 <= (-1.15d-169)) then
tmp = t_0
else if (x1 <= 2.6d-162) then
tmp = ((((-12.0d0) * x1) - 6.0d0) * x2) + -x1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0));
double tmp;
if (x1 <= -8e+92) {
tmp = x1 * ((-12.0 * x2) - 1.0);
} else if (x1 <= -1.15e-169) {
tmp = t_0;
} else if (x1 <= 2.6e-162) {
tmp = (((-12.0 * x1) - 6.0) * x2) + -x1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0)) tmp = 0 if x1 <= -8e+92: tmp = x1 * ((-12.0 * x2) - 1.0) elif x1 <= -1.15e-169: tmp = t_0 elif x1 <= 2.6e-162: tmp = (((-12.0 * x1) - 6.0) * x2) + -x1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(x2 * Float64(Float64(8.0 * x2) - 12.0)) - 1.0))) tmp = 0.0 if (x1 <= -8e+92) tmp = Float64(x1 * Float64(Float64(-12.0 * x2) - 1.0)); elseif (x1 <= -1.15e-169) tmp = t_0; elseif (x1 <= 2.6e-162) tmp = Float64(Float64(Float64(Float64(-12.0 * x1) - 6.0) * x2) + Float64(-x1)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0)); tmp = 0.0; if (x1 <= -8e+92) tmp = x1 * ((-12.0 * x2) - 1.0); elseif (x1 <= -1.15e-169) tmp = t_0; elseif (x1 <= 2.6e-162) tmp = (((-12.0 * x1) - 6.0) * x2) + -x1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(x2 * N[(N[(8.0 * x2), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8e+92], N[(x1 * N[(N[(-12.0 * x2), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.15e-169], t$95$0, If[LessEqual[x1, 2.6e-162], N[(N[(N[(N[(-12.0 * x1), $MachinePrecision] - 6.0), $MachinePrecision] * x2), $MachinePrecision] + (-x1)), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := -6 \cdot x2 + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)\\
\mathbf{if}\;x1 \leq -8 \cdot 10^{+92}:\\
\;\;\;\;x1 \cdot \left(-12 \cdot x2 - 1\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.6 \cdot 10^{-162}:\\
\;\;\;\;\left(-12 \cdot x1 - 6\right) \cdot x2 + \left(-x1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x1 < -8.0000000000000003e92Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.2%
Applied rewrites20.2%
if -8.0000000000000003e92 < x1 < -1.15e-169 or 2.6e-162 < x1 Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f6454.3%
Applied rewrites54.3%
if -1.15e-169 < x1 < 2.6e-162Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6443.8%
Applied rewrites43.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))))
(t_4 (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 1.0))))
(if (<= t_3 -2e+306)
t_4
(if (<= t_3 1e+231) (+ (* -1.0 x1) (* x2 -6.0)) t_4))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double t_4 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
double tmp;
if (t_3 <= -2e+306) {
tmp = t_4;
} else if (t_3 <= 1e+231) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = t_4;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
t_4 = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 1.0d0)
if (t_3 <= (-2d+306)) then
tmp = t_4
else if (t_3 <= 1d+231) then
tmp = ((-1.0d0) * x1) + (x2 * (-6.0d0))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double t_4 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
double tmp;
if (t_3 <= -2e+306) {
tmp = t_4;
} else if (t_3 <= 1e+231) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) t_4 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0) tmp = 0 if t_3 <= -2e+306: tmp = t_4 elif t_3 <= 1e+231: tmp = (-1.0 * x1) + (x2 * -6.0) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) t_4 = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 1.0)) tmp = 0.0 if (t_3 <= -2e+306) tmp = t_4; elseif (t_3 <= 1e+231) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * -6.0)); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); t_4 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0); tmp = 0.0; if (t_3 <= -2e+306) tmp = t_4; elseif (t_3 <= 1e+231) tmp = (-1.0 * x1) + (x2 * -6.0); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+306], t$95$4, If[LessEqual[t$95$3, 1e+231], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
t_4 := x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 1\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+306}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 10^{+231}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -2e306 or 1.0000000000000001e231 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6433.4%
Applied rewrites33.4%
if -2e306 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1.0000000000000001e231Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x1 around 0
Applied rewrites37.9%
(FPCore (x1 x2) :precision binary64 (+ (* (- (* -12.0 x1) 6.0) x2) (- x1)))
double code(double x1, double x2) {
return (((-12.0 * x1) - 6.0) * x2) + -x1;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = ((((-12.0d0) * x1) - 6.0d0) * x2) + -x1
end function
public static double code(double x1, double x2) {
return (((-12.0 * x1) - 6.0) * x2) + -x1;
}
def code(x1, x2): return (((-12.0 * x1) - 6.0) * x2) + -x1
function code(x1, x2) return Float64(Float64(Float64(Float64(-12.0 * x1) - 6.0) * x2) + Float64(-x1)) end
function tmp = code(x1, x2) tmp = (((-12.0 * x1) - 6.0) * x2) + -x1; end
code[x1_, x2_] := N[(N[(N[(N[(-12.0 * x1), $MachinePrecision] - 6.0), $MachinePrecision] * x2), $MachinePrecision] + (-x1)), $MachinePrecision]
\left(-12 \cdot x1 - 6\right) \cdot x2 + \left(-x1\right)
Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6443.8%
Applied rewrites43.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
1e+308)
(+ (* -1.0 x1) (* x2 -6.0))
(* x1 (- (* -12.0 x2) 1.0)))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+308) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = x1 * ((-12.0 * x2) - 1.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))) <= 1d+308) then
tmp = ((-1.0d0) * x1) + (x2 * (-6.0d0))
else
tmp = x1 * (((-12.0d0) * x2) - 1.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+308) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = x1 * ((-12.0 * x2) - 1.0);
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+308: tmp = (-1.0 * x1) + (x2 * -6.0) else: tmp = x1 * ((-12.0 * x2) - 1.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= 1e+308) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * -6.0)); else tmp = Float64(x1 * Float64(Float64(-12.0 * x2) - 1.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+308) tmp = (-1.0 * x1) + (x2 * -6.0); else tmp = x1 * ((-12.0 * x2) - 1.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+308], N[(N[(-1.0 * x1), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(-12.0 * x2), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq 10^{+308}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-12 \cdot x2 - 1\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1e308Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x1 around 0
Applied rewrites37.9%
if 1e308 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.2%
Applied rewrites20.2%
(FPCore (x1 x2) :precision binary64 (let* ((t_0 (* x1 (- (* -12.0 x2) 1.0)))) (if (<= x1 -1.9e-122) t_0 (if (<= x1 1.5e-131) (* -6.0 x2) t_0))))
double code(double x1, double x2) {
double t_0 = x1 * ((-12.0 * x2) - 1.0);
double tmp;
if (x1 <= -1.9e-122) {
tmp = t_0;
} else if (x1 <= 1.5e-131) {
tmp = -6.0 * x2;
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * (((-12.0d0) * x2) - 1.0d0)
if (x1 <= (-1.9d-122)) then
tmp = t_0
else if (x1 <= 1.5d-131) then
tmp = (-6.0d0) * x2
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((-12.0 * x2) - 1.0);
double tmp;
if (x1 <= -1.9e-122) {
tmp = t_0;
} else if (x1 <= 1.5e-131) {
tmp = -6.0 * x2;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((-12.0 * x2) - 1.0) tmp = 0 if x1 <= -1.9e-122: tmp = t_0 elif x1 <= 1.5e-131: tmp = -6.0 * x2 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(-12.0 * x2) - 1.0)) tmp = 0.0 if (x1 <= -1.9e-122) tmp = t_0; elseif (x1 <= 1.5e-131) tmp = Float64(-6.0 * x2); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((-12.0 * x2) - 1.0); tmp = 0.0; if (x1 <= -1.9e-122) tmp = t_0; elseif (x1 <= 1.5e-131) tmp = -6.0 * x2; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(-12.0 * x2), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.9e-122], t$95$0, If[LessEqual[x1, 1.5e-131], N[(-6.0 * x2), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x1 \cdot \left(-12 \cdot x2 - 1\right)\\
\mathbf{if}\;x1 \leq -1.9 \cdot 10^{-122}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-131}:\\
\;\;\;\;-6 \cdot x2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x1 < -1.9e-122 or 1.5e-131 < x1 Initial program 69.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites54.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6443.8%
Applied rewrites43.8%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.2%
Applied rewrites20.2%
if -1.9e-122 < x1 < 1.5e-131Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6425.7%
Applied rewrites25.7%
(FPCore (x1 x2) :precision binary64 (* -6.0 x2))
double code(double x1, double x2) {
return -6.0 * x2;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (-6.0d0) * x2
end function
public static double code(double x1, double x2) {
return -6.0 * x2;
}
def code(x1, x2): return -6.0 * x2
function code(x1, x2) return Float64(-6.0 * x2) end
function tmp = code(x1, x2) tmp = -6.0 * x2; end
code[x1_, x2_] := N[(-6.0 * x2), $MachinePrecision]
-6 \cdot x2
Initial program 69.7%
Applied rewrites69.8%
Taylor expanded in x1 around 0
lower-*.f6425.7%
Applied rewrites25.7%
herbie shell --seed 2025258
(FPCore (x1 x2)
:name "Rosa's FloatVsDoubleBenchmark"
:precision binary64
(+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2.0 x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) (- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0)) (* (* x1 x1) (- (* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) 6.0))) (+ (* x1 x1) 1.0)) (* (* (* 3.0 x1) x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))) (* (* x1 x1) x1)) x1) (* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))